C# 클래스 KineticMath.Controllers.BalanceGame

Controls dynamic of the balance game
상속: System.Windows.DependencyObject
파일 보기 프로젝트 열기: kingston/kineticmath 1 사용 예제들

공개 메소드들

메소드 설명
AddBallToBalance ( KineticMath.SubControls.SeesawObject ball, bool leftSide ) : void

Adds a ball to the balance

BalanceGame ( ) : System
GetBalanceOffset ( ) : double
GetMaximumValue ( ) : int

Gets the maximum value one side can have (used by Seesaw for angle adjusting)

LoadCurrentLevel ( ) : void
NewGame ( ) : void

Starts a new game and resets everything

PushBall ( KineticMath.SubControls.SeesawObject ball ) : bool

Pushes a ball from the HeldBalls section in the assumption that it'll trigger an animation

Reset ( ) : void

Resets the board to the current level

VerifySolution ( ) : void

Called when the balance has stopped moving and is good to go

비공개 메소드들

메소드 설명
GetAnswerSet ( int answer, bool moreRandomness = false ) : List
GetRandomPartsToSum ( int numParts, int targetSum ) : int[]

Produces a random array of integers that sum to a target sum

SetupLevel ( ) : void
timerHandler ( Object sender, EventArgs args ) : void

Starts a new game and resets everything

메소드 상세

AddBallToBalance() 공개 메소드

Adds a ball to the balance
public AddBallToBalance ( KineticMath.SubControls.SeesawObject ball, bool leftSide ) : void
ball KineticMath.SubControls.SeesawObject
leftSide bool
리턴 void

BalanceGame() 공개 메소드

public BalanceGame ( ) : System
리턴 System

GetBalanceOffset() 공개 메소드

public GetBalanceOffset ( ) : double
리턴 double

GetMaximumValue() 공개 메소드

Gets the maximum value one side can have (used by Seesaw for angle adjusting)
public GetMaximumValue ( ) : int
리턴 int

LoadCurrentLevel() 공개 메소드

public LoadCurrentLevel ( ) : void
리턴 void

NewGame() 공개 메소드

Starts a new game and resets everything
public NewGame ( ) : void
리턴 void

PushBall() 공개 메소드

Pushes a ball from the HeldBalls section in the assumption that it'll trigger an animation
public PushBall ( KineticMath.SubControls.SeesawObject ball ) : bool
ball KineticMath.SubControls.SeesawObject The ball to remove
리턴 bool

Reset() 공개 메소드

Resets the board to the current level
public Reset ( ) : void
리턴 void

VerifySolution() 공개 메소드

Called when the balance has stopped moving and is good to go
public VerifySolution ( ) : void
리턴 void