|
CBG
0.1
Compendium of board games
|
#include <Square.h>
Public Member Functions | |
| Square () | |
| Square (int identifier, string start, string end, int amountOfPlayers, Coordinate position) | |
| ~Square () | |
| Deconstructor to clear the pieces vector. More... | |
| int | getIdentifier () const |
| Returns the square's identifier. More... | |
| bool | hasPiece () |
| Returns whether or not the square has a piece on it. More... | |
| bool | addPiece (int Player, Piece &piece) |
| Adds a piece to the square. More... | |
| bool | removePiece (int player) |
| Removes a piece from the square. More... | |
| bool | hasPieceOwnedBy (int player) const |
| Returns whether or not the square has a piece owned by player on it. More... | |
| string | getStart () |
| Returns the start string of a square. More... | |
| string | getEnd () |
| Returns the closing string of a square. More... | |
| Piece & | getPiece (int player) |
| Returns the piece on the square owned by player. More... | |
| Coordinate & | getPosition () const |
| Returns the position of the square. More... | |
Protected Attributes | |
| int | identifier |
| Identifier for the square. More... | |
| int | amountOfPlayers |
| The length of the pieces vector. More... | |
| int | numberOfOccupants |
| The number of people currently on the square. More... | |
| string | start |
| The starting string of the square. More... | |
| string | end |
| The closing string of the square. More... | |
| vector< Piece * > | pieces |
| Pointers to all the pieces on the square. More... | |
| Coordinate | position |
| The coordinate of the square. More... | |
Friends | |
| ostream & | operator<< (ostream &out, const Square &square) |
| Overrides the insert operator for a square. More... | |
| Square::Square | ( | ) |
A square makes up the grid/board for each game.
| Square::Square | ( | int | identifier, |
| string | start, | ||
| string | end, | ||
| int | amountOfPlayers, | ||
| Coordinate | position | ||
| ) |
| Square::~Square | ( | ) |
Deconstructor to clear the pieces vector.
| bool Square::addPiece | ( | int | Player, |
| Piece & | piece | ||
| ) |
Adds a piece to the square.
| string Square::getEnd | ( | ) |
Returns the closing string of a square.
| int Square::getIdentifier | ( | ) | const |
Returns the square's identifier.
| Piece & Square::getPiece | ( | int | player | ) |
Returns the piece on the square owned by player.
| Coordinate & Square::getPosition | ( | ) | const |
Returns the position of the square.
| string Square::getStart | ( | ) |
Returns the start string of a square.
| bool Square::hasPiece | ( | ) |
Returns whether or not the square has a piece on it.
| bool Square::hasPieceOwnedBy | ( | int | player | ) | const |
Returns whether or not the square has a piece owned by player on it.
| bool Square::removePiece | ( | int | player | ) |
Removes a piece from the square.
|
friend |
Overrides the insert operator for a square.
|
protected |
The length of the pieces vector.
|
protected |
The closing string of the square.
|
protected |
Identifier for the square.
|
protected |
The number of people currently on the square.
|
protected |
Pointers to all the pieces on the square.
|
protected |
The coordinate of the square.
|
protected |
The starting string of the square.