rp-scrabble
Simple, terminal-based Scrabble game
|
#include <player.h>
Public Member Functions | |
Player (std::string n) | |
~Player () | |
std::string | getName () |
void | setName (std::string) |
void | toggleTurn () |
void | updateScore (int points) |
int | getScore () |
Tile * | tileFromRack (int index) |
bool | placeTile (Tile *t, Board *b, int r, int c) |
std::vector< Tile * > | placeTileStr (std::string str, Board *b, int r, int c, char dir) |
void | draw (int count, Bag *b) |
bool | rackIsEmpty () |
void | returnToRack (Tile *t, Board *b) |
void | showScore () |
void | show () |
Private Attributes | |
int | score |
bool | turn |
std::string | playerName |
Rack * | rack |
Implements a player
Each player has a name, a rack, and a score associated with them
Player::Player | ( | std::string | n | ) |
void Player::draw | ( | int | count, |
Bag * | b | ||
) |
string Player::getName | ( | ) |
int Player::getScore | ( | ) |
t | Pointer to the Tile to be placed |
b | Pointer of Board to place on |
r | Row where Square to be returned is |
c | Column where Square to be returned is |
std::string | containing the error message |
Definition at line 133 of file player.cc.
Place a series of Tiles on the Board
str | A string of letters that represent Tiles |
b | Pointer to the Board where the Tiles must be placed |
r | Row where the first Tile goes |
c | Column where the first Tile goes |
dir | Direction of placement ('h'/'v') |
std::string | containing error message |
Definition at line 175 of file player.cc.
bool Player::rackIsEmpty | ( | ) |
void Player::setName | ( | std::string | name | ) |
void Player::showScore | ( | ) |
Tile * Player::tileFromRack | ( | int | index | ) |
void Player::toggleTurn | ( | ) |
void Player::updateScore | ( | int | points | ) |