-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.hpp
145 lines (127 loc) · 4.35 KB
/
Player.hpp
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
//----------------------------------------------------------------------------------------------------------------------
// Player.hpp
//
// This is the Player class
// with its attributes and functions.
//
// Authors: 11804229
// 11814996
// 00713374
//----------------------------------------------------------------------------------------------------------------------
//
#ifndef PLAYER_HPP
#define PLAYER_HPP
#include "Treasure.hpp"
#include <vector>
#include <string>
#include <iostream>
#include <stack>
#include <sstream>
class Player
{
private:
std::stack<Treasure*> covered_stack_ = {};
size_t nr_found_treasures_ = 0;
std::string color_;
std::vector<Treasure*> treasures_per_player_ = {};
public:
//------------------------------------------------------------------------------------------------------------------
///
/// Default Player constructor.
///
///
///
//
Player(std::string color) : color_{color}{}
//------------------------------------------------------------------------------------------------------------------
///
/// Player copy-constructor.
///
///
///
//
Player(Player const&) = delete;
//------------------------------------------------------------------------------------------------------------------
///
/// UserInput destructor.
///
///
///
//
~Player(){}
//------------------------------------------------------------------------------------------------------------------
///
/// Pushs a treasure to the vector of treasures.
///
/// @param treasure Pointer of a treasure
///
/// @return void
//
void pushToVector(Treasure* treasure){ treasures_per_player_.push_back(treasure); }
//------------------------------------------------------------------------------------------------------------------
///
/// Pushs a treasure to local vector of treasures.
///
/// @param treasure Pointer of a treasure
///
/// @return void
//
void pushBackTreasureStack(Treasure* treasure){ covered_stack_.push(treasure); }
//------------------------------------------------------------------------------------------------------------------
///
/// Pops a treasure from local vector of treasures.
///
/// @return void
//
void popFrontTreasureStack();
//------------------------------------------------------------------------------------------------------------------
///
/// Returns the size of the local vector of tresures.
///
/// @return size_t size of the vector
//
size_t getStackSize(){ return covered_stack_.size(); }
//------------------------------------------------------------------------------------------------------------------
///
/// Returns the number of found treasures.
///
/// @return size_t number of found treasures
//
size_t getNrFoundTreasures(){ return nr_found_treasures_; }
//------------------------------------------------------------------------------------------------------------------
///
/// Returns the number of found treasures.
///
/// @return bool true if it´s empty, otherwise false
//
bool stackEmpty();
//------------------------------------------------------------------------------------------------------------------
///
/// Returns the name of the current treasure.
///
/// @return string name as a string
//
std::string getCurrentTreasureName();
//------------------------------------------------------------------------------------------------------------------
///
/// Returns the id of the current treasure.
///
/// @return string id as a string
//
std::string getCurrentTreasureId();
//------------------------------------------------------------------------------------------------------------------
///
/// Returns the color of the player.
///
/// @return string color of a player
//
std::string getColor(){ return color_; }
//------------------------------------------------------------------------------------------------------------------
///
/// sets the color of the player to given color.
///
/// @return string color of a player
//
void setColor(std::string color){ color_ = color; }
};
#endif // PLAYER_HPP