#include <Player.h>
Public constructors.
Player
- Author
- Ian Duffy
-
Darren Brogan
| Player::Player |
( |
int |
amountOfTypes, |
|
|
vector< string > |
types, |
|
|
int |
maxPieces |
|
) |
| |
| Piece & Player::addPiece |
( |
| ) |
|
Add pieces to the pieces vector.
Add pieces to the pieces vector at index. Only used by snakes and ladders.
| int Player::getAmountOfPieces |
( |
| ) |
const |
Public functions.
Returns the amount of pieces.
| std::string Player::getCharacter |
( |
int |
type | ) |
const |
Returns a string from pieces vector at index type.
| Piece & Player::getPiece |
( |
int |
index | ) |
const |
Returns a reference to the piece in the pieces vector at index.
| bool Player::hasRoomForPiece |
( |
| ) |
const |
Function to check does the player have room for another piece Necessary to check before adding piece to ensure references never reference a non existant piece.
| bool Player::hasType |
( |
int |
type | ) |
const |
Check if pieces vector at index type is empty.
| bool Player::removePiece |
( |
Piece * |
toBeRemoved | ) |
|
Remove Piece from the player and return a bollean to identify if it succeded or failed.
Remove Piece from the player and return a boolean to identify if it succeded or failed.
| int Player::amountOfPieces |
|
protected |
Protected Data. Int to store the amount of pieces the player currently owns.
| int Player::amountOfTypes |
|
protected |
Variable used to store the amount of types of pieces the player has.
Int variable to store the max amount of pieces a player could own.
| vector<Piece*> Player::pieces |
|
protected |
Vector of type Piece pointer to store all the pieces the player owns.
Return weather this player can move or not.
| vector<string> Player::types |
|
protected |
Vector to store the different types of pieces the player could own.
The documentation for this class was generated from the following files: