-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.h
38 lines (31 loc) · 991 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
#ifndef ASSIGN2_PLAYER_H
#define ASSIGN2_PLAYER_H
#include "LinkedList.h"
#include <iostream>
#include <vector>
#include <unordered_set>
class Player {
public:
Player();
~Player();
// Set player name
void setName(std::string name);
// Generate a hand of 7 tiles from the tile bag
void createHand(LinkedList* tileBag);
// Change turn
void changeTurn();
// Replace chosend tile in hand with tile from top of bag
void replaceTile(LinkedList* tileBag, Letter letter);
// Check if a tile can be placed on the board
bool placeCheck(char letter, std::string pos, std::vector<std::vector<Tile*>>* boardPtr);
// Place word on board
bool placeWord(std::vector<Tile*> word, std::vector<std::vector<Tile*>>* boardPtr, char checker, std::unordered_set<std::string> wordList);
std::string name;
int score;
bool turn;
LinkedList* hand;
std::string colour;
// number of times a player passes
int pass;
};
#endif // ASSIGN2_PLAYER_H