CBG  0.1
Compendium of board games
GameWithXYSelector Class Reference

#include <GameWithXYSelector.h>

Inheritance diagram for GameWithXYSelector:
Game Checkers Reversi

Public Member Functions

 GameWithXYSelector (const int amountOfPlayers, const int columns, const int rows)
 
- Public Member Functions inherited from Game
 Game (const int amountOfPlayers, const int columns, const int rows)
 
virtual ~Game ()
 
virtual void start ()
 

Protected Member Functions

void drawScreen () const
 Prints out the board and the players pieces. More...
 
int getPoint (string message, int range) const
 Prompts with message to get a point between 0 and range. More...
 
int getOpposition () const
 Returns the opposition. More...
 
- Protected Member Functions inherited from Game
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 int isOver ()=0
 Defines whether or not the game is over. More...
 

Additional Inherited Members

- Protected Attributes inherited from Game
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...
 

Detailed Description

Common functions between games that use X, Y selectors.

Author
Peter Morgan

Constructor & Destructor Documentation

GameWithXYSelector::GameWithXYSelector ( const int  amountOfPlayers,
const int  columns,
const int  rows 
)

Member Function Documentation

void GameWithXYSelector::drawScreen ( ) const
protectedvirtual

Prints out the board and the players pieces.

Prints out the board and all the players pieces.

Implements Game.

int GameWithXYSelector::getOpposition ( ) const
protected

Returns the opposition.

int GameWithXYSelector::getPoint ( string  message,
int  range 
) const
protected

Prompts with message to get a point between 0 and range.

Prints out the board and the players pieces. Prompts with message to get a point between 0 and range.


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