rp-scrabble
Simple, terminal-based Scrabble game
player.h
Go to the documentation of this file.
1 
4 #ifndef PLAYER_H
5 #define PLAYER_H
6 #include <string>
7 #include <vector>
8 
9 class Rack;
10 class Bag;
11 class Tile;
12 class Board;
13 
19 class Player {
20 private:
21  int score;
22  bool turn;
23  std::string playerName;
25 
26 public:
27  Player(std::string n);
28  ~Player();
29 
30  std::string getName();
31  void setName(std::string);
32  void toggleTurn();
33  void updateScore(int points);
34  int getScore();
35  Tile* tileFromRack(int index);
36 
37  bool placeTile(Tile* t, Board* b, int r, int c);
38  std::vector<Tile*> placeTileStr(std::string str, Board* b, int r, int c, char dir);
39  void draw(int count, Bag* b);
40  bool rackIsEmpty();
41  void returnToRack(Tile* t, Board* b);
42  void showScore();
43  void show();
44 };
45 
46 #endif
Definition: bag.h:15
Definition: board.h:20
Definition: player.h:19
bool placeTile(Tile *t, Board *b, int r, int c)
Definition: player.cc:133
void showScore()
Definition: player.cc:52
void show()
Definition: player.cc:40
bool turn
Definition: player.h:22
~Player()
Definition: player.cc:32
Tile * tileFromRack(int index)
Definition: player.cc:159
Rack * rack
Definition: player.h:24
void updateScore(int points)
Definition: player.cc:101
bool rackIsEmpty()
Definition: player.cc:195
int getScore()
Definition: player.cc:77
void returnToRack(Tile *t, Board *b)
Definition: player.cc:208
void draw(int count, Bag *b)
Definition: player.cc:114
std::vector< Tile * > placeTileStr(std::string str, Board *b, int r, int c, char dir)
Definition: player.cc:175
std::string playerName
Definition: player.h:23
int score
Definition: player.h:21
void setName(std::string)
Definition: player.cc:89
void toggleTurn()
Definition: player.cc:143
Player(std::string n)
Definition: player.cc:21
std::string getName()
Definition: player.cc:67
Definition: rack.h:17
Definition: tile.h:22