C# Class BalloonsPop.LogicProvider.LogicProvider

Implements IGameLogicProvider and defines operation on IGameModel type and it's properties and provides instances access to them.
Inheritance: IGameLogicProvider
Mostrar archivo Open project: Baloons-Pop-4/Main

Public Methods

Method Description
GameIsOver ( IBalloon matrix ) : bool

Determines whether a game is over.

LetBalloonsFall ( IBalloon field ) : void

Moves all non-popped balloons vertically to the bottom of the array, effectively simulating gravity.

LogicProvider ( IMatrixValidator matrixValidator, IRandomNumberGenerator rng ) : System

Initializes a new instance of the LogicProvider class with matrix validator and random number generator.

PopBalloons ( IBalloon field, int row, int column ) : void

Provides popping logic based on field, row and column.

RandomizeBalloonField ( IBalloon field ) : void

Provides randomization of a balloon field represented as two-dimensional array.

Method Details

GameIsOver() public method

Determines whether a game is over.
public GameIsOver ( IBalloon matrix ) : bool
matrix IBalloon Array representation of the game field.
return bool

LetBalloonsFall() public method

Moves all non-popped balloons vertically to the bottom of the array, effectively simulating gravity.
public LetBalloonsFall ( IBalloon field ) : void
field IBalloon Array representation of the game field.
return void

LogicProvider() public method

Initializes a new instance of the LogicProvider class with matrix validator and random number generator.
public LogicProvider ( IMatrixValidator matrixValidator, IRandomNumberGenerator rng ) : System
matrixValidator IMatrixValidator The matrix validator.
rng IRandomNumberGenerator The random byte generator.
return System

PopBalloons() public method

Provides popping logic based on field, row and column.
public PopBalloons ( IBalloon field, int row, int column ) : void
field IBalloon Array representation of the game field.
row int The number of rows in the field.
column int The number of columns in the field.
return void

RandomizeBalloonField() public method

Provides randomization of a balloon field represented as two-dimensional array.
public RandomizeBalloonField ( IBalloon field ) : void
field IBalloon The array representation of a game field.
return void