-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.hpp
166 lines (140 loc) · 4.64 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
//------------------------------------------------------------------------------
// Player.hpp
//
// Authors: Michael Zweimüller 11916150
// Martin Schachl 11907003
// Johannes Aigner 11907005
//------------------------------------------------------------------------------
//
#ifndef INCLUDE_PLAYER_H
#define INCLUDE_PLAYER_H
#include <string>
#include <vector>
//------------------------------------------------------------------------------
namespace Oop
{
class CreatureCard;
class SpellCard;
class Card;
class Interface;
//--------------------------------------------------------------------------
// Player Class
// This class provides an obj for storing all necessary player data.
//
class Player
{
private:
std::string name_;
int life_points_;
int mana_points_;
CreatureCard* game_field_ [7];
std::vector<Card*> pick_up_stack_;
std::vector<Card*> hand_;
std::vector<CreatureCard> graveyard_;
public:
//------------------------------------------------------------------
// Standard constructor
//
Player();
//------------------------------------------------------------------
// Name constructor
//
Player(std::string name);
//------------------------------------------------------------------
// Destructor
//
~Player();
//------------------------------------------------------------------
// The getName function
// Returns the name of the player
//
// @return string containing the name of the player
//
std::string getName() const;
//------------------------------------------------------------------
// The getLifePoints function
// Returns the lifepoints of the player
//
// @return int containing the lifepoints of the player
//
int getLifePoints() const;
//------------------------------------------------------------------
// The addLifePoints function
// Adding lifepoits to the players health
//
// @param int the lifepoits to add
//
void addLifePoints(int points);
//------------------------------------------------------------------
// The getManaPoints function
// Returns the manapoints of the player
//
// @return int containing the manapoints of the player
//
int getManaPoints() const;
//------------------------------------------------------------------
// The addMana function
// Adding manapoints to the players manapool
// Max mana points = 15 so shoot over gets ignored
//
// @param int the mana to add
//
void addMana(int mana);
//------------------------------------------------------------------
// The reduceMana function
// Reducing manapoints from the players manapool
// Min mana points = 0 so shoot over gets ignored
//
// @param int the mana to reduce
//
void reduceMana(int mana);
//------------------------------------------------------------------
// The getHandCards function
// Returning the cards of the player
//
// @return vector<Card*> containing the cards of the player
//
const std::vector<Card*> getHandCards() const;
//------------------------------------------------------------------
// The getHandSize function
// Returning the number of cards from the player
//
// @return int containing the number of cards form the player
//
int getHandSize() const;
//------------------------------------------------------------------
// The getGameField function
// Returning the gamefield
//
// @return CreatureCard* containing the gamefield
//
const CreatureCard* const* getGameField() const;
//------------------------------------------------------------------
// The copyPickUpStack function
// Makes a deep copy of the original pick up stack
//
void copyPickUpStack(std::vector<Card*> &pick_up_stack);
//------------------------------------------------------------------
// The setName function
// Sets the name of the player
//
void setName(std::string name);
//------------------------------------------------------------------
// The shufflePickUpStack function
// shuffles the pick up stack with function of class Random
//
void shufflePickUpStack();
//------------------------------------------------------------------
// The takeOffCards function
// Taking off number of cards and adding to hand cards
//
// @param amount of taken cards
//
void takeOffCards(int amount);
/////////////////////////////////////////////////////////////////////////////////////
void setCardOnGameField(long x, long y);
void setAllFieldCardsRdy();
bool reduceLifePoints(int life_points);
};
}
#endif