C# Class KineticMath.Controllers.BalanceGame

Controls dynamic of the balance game
Inheritance: System.Windows.DependencyObject
Afficher le fichier Open project: kingston/kineticmath Class Usage Examples

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
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

Method Details

AddBallToBalance() public méthode

Adds a ball to the balance
public AddBallToBalance ( KineticMath.SubControls.SeesawObject ball, bool leftSide ) : void
ball KineticMath.SubControls.SeesawObject
leftSide bool
Résultat void

BalanceGame() public méthode

public BalanceGame ( ) : System
Résultat System

GetBalanceOffset() public méthode

public GetBalanceOffset ( ) : double
Résultat double

GetMaximumValue() public méthode

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

LoadCurrentLevel() public méthode

public LoadCurrentLevel ( ) : void
Résultat void

NewGame() public méthode

Starts a new game and resets everything
public NewGame ( ) : void
Résultat void

PushBall() public méthode

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
Résultat bool

Reset() public méthode

Resets the board to the current level
public Reset ( ) : void
Résultat void

VerifySolution() public méthode

Called when the balance has stopped moving and is good to go
public VerifySolution ( ) : void
Résultat void