Tetris
Game Class Reference
Inheritance diagram for Game:

Public Member Functions

 Game (string userName, Grid grid)
 
bool HitBottom ()
 Return true if the current tetrominoe can't go down one row More...
 
bool HitTop ()
 If the current tetrominoe can go down one, return false. Otherwise, return true if the current tetrominoe is at the top of the grid More...
 
void ClearLine ()
 It checks if there is a full line, if there is, it clears it and adds to the score
 
void PrintTetrominoe ()
 Print the tetrominoe to the grid, and if the game is playing, set the current tetrominoe to the next tetrominoe and get a new next tetrominoe More...
 
Tetrominoe GetNewTetrominoe ()
 Get a random tetrominoe from the list of tetrominoe strings, and return a new Tetrominoe object with that string. More...
 
void SaveGame ()
 Save the score to the scoreboard
 

Protected Member Functions

virtual void OnPropertyChanged (string propertyName)
 

Properties

string UserName [get, set]
 
int Score [get, set]
 
bool Playing [get, set]
 
Grid Grid [get]
 
TetrominoeCurrentTetrominoe [get]
 
TetrominoeNextTetrominoe [get]
 

Events

PropertyChangedEventHandler PropertyChanged
 

Member Function Documentation

◆ GetNewTetrominoe()

Tetrominoe Game.GetNewTetrominoe ( )

Get a random tetrominoe from the list of tetrominoe strings, and return a new Tetrominoe object with that string.

Returns
A new Tetrominoe object.

◆ HitBottom()

bool Game.HitBottom ( )

Return true if the current tetrominoe can't go down one row

Returns
A boolean value.

◆ HitTop()

bool Game.HitTop ( )

If the current tetrominoe can go down one, return false. Otherwise, return true if the current tetrominoe is at the top of the grid

Returns
a boolean value.

◆ PrintTetrominoe()

void Game.PrintTetrominoe ( )

Print the tetrominoe to the grid, and if the game is playing, set the current tetrominoe to the next tetrominoe and get a new next tetrominoe

Returns
The current tetrominoe is being returned.

The documentation for this class was generated from the following file: