|
CBG
0.1
Compendium of board games
|
#include <Game.h>
Public Member Functions | |
| Game (const int amountOfPlayers, const int columns, const int rows) | |
| virtual | ~Game () |
| virtual void | start () |
Protected Member Functions | |
| void | clearScreen () const |
| Clears the terminal window. More... | |
| virtual bool | getMove ()=0 |
| Gets input from the player detailing which move they wish to make. More... | |
| virtual void | drawScreen () const =0 |
| Draws out the board as required. More... | |
| virtual int | isOver ()=0 |
| Defines whether or not the game is over. More... | |
Protected Attributes | |
| int | currentPlayer |
| Holds the position in the players array of the current player. More... | |
| Player ** | players |
| Holds all of the games players. More... | |
| Square ** | grid |
| Holds all of the squares that makes up the games grid. More... | |
| const int | amountOfPlayers |
| Holds the length of the players array. More... | |
| const int | columns |
| Holds the amount of columns within the grid. More... | |
| const int | rows |
| Holds the amount of rows within the grid. More... | |
Base foundation for all of the games.
| Game::Game | ( | const int | amountOfPlayers, |
| const int | columns, | ||
| const int | rows | ||
| ) |
|
virtual |
|
protected |
Clears the terminal window.
|
protectedpure virtual |
Draws out the board as required.
Implemented in ConnectFour, SnakesAndLadders, and GameWithXYSelector.
|
protectedpure virtual |
Gets input from the player detailing which move they wish to make.
Implemented in ConnectFour, SnakesAndLadders, Checkers, and Reversi.
|
protectedpure virtual |
Defines whether or not the game is over.
Implemented in SnakesAndLadders, ConnectFour, Checkers, and Reversi.
|
virtual |
|
protected |
Holds the length of the players array.
|
protected |
Holds the amount of columns within the grid.
|
protected |
Holds the position in the players array of the current player.
|
protected |
Holds all of the squares that makes up the games grid.
|
protected |
Holds all of the games players.
|
protected |
Holds the amount of rows within the grid.