-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathplayer.h
52 lines (37 loc) · 867 Bytes
/
player.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
44
45
46
47
48
49
50
51
52
// player.h
#ifndef PLAYER_H
#define PLAYER_H
#include<string>
#include<vector>
#include<iostream>
class Rack;
class Bag;
class Board;
class Tile; // needed?
struct move{
std::string placedletters;
std::vector<std::string> words;
std::vector<int> scores;
};
enum direction{HORIZONTAL, VERTICAL, NODIR};
class Player{
private:
int score;
std::string name;
Rack* rack;
Board& board;
Bag& bag;
std::vector<struct move> moves;
struct move placeLetters(std::string letters, int index, direction dir);
bool canPlaceLetters(std::string letters, int index, direction dir);
void getInput( std::string& letters, int& locationNdx, char& direction );
void fillRack();
static direction charToDirection(char c);
public:
Player();
Player(std::string s, Board& board, Bag& bag);
~Player();
void selfTest() const;
void playTurn();
};
#endif