C# Класс KineticMath.Controllers.BalanceGame

Controls dynamic of the balance game
Наследование: System.Windows.DependencyObject
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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