forked from cy94/scrabble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
board.h
43 lines (30 loc) · 788 Bytes
/
board.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// board.h
#ifndef BOARD_H
#define BOARD_H
#include<iostream>
#include "square.h" //for enum
class Tile;
class Bag;
class Board{
private:
static const int NUMSQUARES = 225;
static const int NUMROWS = 15;
Square *squares[NUMSQUARES];
static int getX(int);
static int getY(int);
static int getI(int, int);
mutable bool firstword; //used in canPlaceLetters
public:
Board();
~Board();
void show() const;
Tile* getTile(int index) const;
bool addToSquare(int, int, Tile*);
bool addToSquare(int, Tile*); // single index - 0 to 224
bool canPlaceLetters(std::string letters, int index, int dir) const;
void setupBoard(Bag* bag, const char* rows[]);
premium getPremium(int index);
void selfTest() const;
bool firstWord() const { return firstword; }
};
#endif