rp-scrabble
Simple, terminal-based Scrabble game
board.h
Go to the documentation of this file.
1 
4 #ifndef BOARD_H
5 #define BOARD_H
6 #include "square.h"
7 #include "utils.h"
8 #include <array>
9 #include <vector>
10 
11 class Tile;
12 class Player;
13 class Rack;
14 
20 class Board {
21 private:
23  std::array<std::string, 5> sqStrings;
24 
25 public:
26  Board();
27  ~Board();
28 
29  Square* getSquare(int r, int c);
30 
31  void show();
32  bool placeTile(Tile* t, int r, int c);
33  void placeTileStr(Rack* rack, std::vector<Tile*> tilesInStr, int r, int c, char dir);
34  Tile* retrieve(int r, int c);
35 };
36 
37 #endif
Definition: board.h:20
bool placeTile(Tile *t, int r, int c)
Definition: board.cc:213
Square * board[NUM_ROWS][NUM_COLS]
Definition: board.h:22
Tile * retrieve(int r, int c)
Definition: board.cc:301
std::array< std::string, 5 > sqStrings
Definition: board.h:23
Board()
Definition: board.cc:18
void placeTileStr(Rack *rack, std::vector< Tile * > tilesInStr, int r, int c, char dir)
Definition: board.cc:246
void show()
Definition: board.cc:121
~Board()
Definition: board.cc:109
Square * getSquare(int r, int c)
Definition: board.cc:321
Definition: player.h:19
Definition: rack.h:17
Definition: square.h:30
Definition: tile.h:22
#define NUM_COLS
Definition: utils.h:19
#define NUM_ROWS
Definition: utils.h:17