-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
60 lines (40 loc) · 1.15 KB
/
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
53
54
55
56
57
58
59
60
#ifndef ASSIGN2_PLAYER_H
#define ASSIGN2_PLAYER_H
#include <string>
#include "LinkedList.h"
#include "Tile.h"
#include <memory>
// class LinkedList;
// class Tile;
class Player {
public:
// Constructor
explicit Player(string name);
// Destructor
~Player();
// Adds a Tile to the player's hand with the given tile
void addTile(const SharedTile& tile);
// Getter methods
string getName();
int getScore();
// Whether the player has the given tile on hand
SharedTile hasTile(Colour color, Shape shape);
//Return a player's hand
std::shared_ptr<LinkedList> getHand();
//Set a player's hand
void setHand(std::shared_ptr<LinkedList> hand);
//Remove the given tile from the player
bool removeTile(const SharedTile& tile);
// Adds score to the player
void addScore(int score);
// Setter method
void setScore(int score);
// ToString method
string toString(bool isColour, bool isSaving);
private:
// Class Variables
string name;
int score;
std::shared_ptr<LinkedList> hand;
};
#endif // ASSIGN2_PLAYER_H