rp-scrabble
Simple, terminal-based Scrabble game
play.h
Go to the documentation of this file.
1 
4 #ifndef PLAY_H
5 #define PLAY_H
6 #include <string>
7 #include <vector>
8 
19 class Player;
20 class Board;
21 class Tile;
22 
23 class Play {
24 private:
27  std::string playStr;
28  std::vector<std::vector<Tile*>> wordsInPlay;
29 
30 public:
31  Play(Player* p);
32  ~Play();
33 
34  void setPlayer(Player* p);
35  bool validate(std::string tileStr, Board* b, int r, int c, char dir);
36  std::vector<std::vector<Tile*>> getWords(std::vector<Tile*> tilesInStr, Board* b, int r, int c, char dir);
37  std::vector<Tile*> getConnectedWord(Tile* t, char dir);
38  void calculatePoints(std::vector<std::vector<Tile*>> words, std::vector<Tile*> tileStrVec);
39  int getPointsMade();
40  bool confirmPlay();
41  void reset();
42  void show();
43 };
44 
45 #endif
Definition: board.h:20
Definition: play.h:23
bool confirmPlay()
Definition: play.cc:363
void reset()
Definition: play.cc:387
Player * playMaker
Definition: play.h:26
void show()
Definition: play.cc:37
Play(Player *p)
Definition: play.cc:19
void calculatePoints(std::vector< std::vector< Tile * >> words, std::vector< Tile * > tileStrVec)
Definition: play.cc:296
std::vector< Tile * > getConnectedWord(Tile *t, char dir)
Definition: play.cc:254
~Play()
Definition: play.cc:29
int getPointsMade()
Definition: play.cc:351
std::vector< std::vector< Tile * > > getWords(std::vector< Tile * > tilesInStr, Board *b, int r, int c, char dir)
Definition: play.cc:175
bool validate(std::string tileStr, Board *b, int r, int c, char dir)
Definition: play.cc:90
std::string playStr
Definition: play.h:27
std::vector< std::vector< Tile * > > wordsInPlay
Definition: play.h:28
int pointsMade
Definition: play.h:25
void setPlayer(Player *p)
Definition: play.cc:62
Definition: player.h:19
Definition: tile.h:22