TheCOSCGameProject  1.0
player.h
Go to the documentation of this file.
1 
7 #ifndef PLAYER_H
8 #define PLAYER_H
9 
10 #include <vector>
11 #include <string>
12 #include <iostream>
13 #include "../lib/toolkit.h" // Assuming this header file contains the declaration of getUserInputToken()
14 
20 class Player
21 {
22 private:
23  int maxHealth;
24  int currHealth;
25  std::vector<std::string> inventory;
26  std::vector<int> numberItems;
27  std::string classType;
28  std::string firstName;
29  int resistance;
30  std::vector<std::string> buffs;
31  int damage;
32  int coins;
33 
34 public:
39  Player();
40 
44  ~Player();
45 
50  void getNameFromUser();
51 
56  void getClassFromUser();
57 
62  bool addToInventory(std::string item);
63 
68  void removeFromInventory(std::string item);
69 
74  void setMaxHelth(int maxHealth);
75 
80  void setCurrHealth(int health);
81 
86  void addBuff(std::string buff);
87 
92  void removeBuff(std::string buff);
93 
98  void setResistance(int resistance);
99 
104  std::string getName();
105 
110  std::string getClassType();
111 
116  std::vector<std::string> getInventory();
117 
122  int getMaxHealth();
123 
128  int *getCurrHealth();
129 
134  int getResistance();
135 
140  std::vector<std::string> getBuffs();
141 
142  bool printInventory();
143 
144  std::vector<int> getNum();
145 
146  void setDamage(int d);
147 
148  int getDamage();
149 
150  bool displayStats();
151 
152  int getCoins();
153 
154  bool setCoinsPlus(int c);
155 
156  bool setCoinsMinus(int c);
157 
158  void heal();
159 };
160 
161 #endif // PLAYER_H
void removeFromInventory(std::string item)
Remove an item from the player&#39;s inventory.
Definition: player.cpp:107
bool displayStats()
Definition: player.cpp:282
void setCurrHealth(int health)
Set the player&#39;s current health.
Definition: player.cpp:145
bool printInventory()
Definition: player.cpp:265
bool addToInventory(std::string item)
Add an item to the player&#39;s inventory.
Definition: player.cpp:58
void getClassFromUser()
Get the player&#39;s class type from user input.
Definition: player.cpp:48
void getNameFromUser()
Get the player&#39;s name from user input.
Definition: player.cpp:38
std::vector< std::string > getInventory()
Get the player&#39;s inventory.
Definition: player.cpp:224
bool setCoinsMinus(int c)
Definition: player.cpp:299
void setDamage(int d)
Definition: player.cpp:92
int getDamage()
Definition: player.cpp:97
void setResistance(int resistance)
Set the player&#39;s resistance value.
Definition: player.cpp:197
int * getCurrHealth()
Get the player&#39;s current health.
Definition: player.cpp:242
int getResistance()
Get the player&#39;s resistance value.
Definition: player.cpp:251
void setMaxHelth(int maxHealth)
Set the player&#39;s maximum health.
Definition: player.cpp:131
std::string getClassType()
Get the player&#39;s class type.
Definition: player.cpp:215
bool setCoinsPlus(int c)
Definition: player.cpp:293
std::string getName()
Get the player&#39;s name.
Definition: player.cpp:206
int getMaxHealth()
Get the player&#39;s maximum health.
Definition: player.cpp:233
void addBuff(std::string buff)
Add a buff to the player.
Definition: player.cpp:165
~Player()
Destructor for the Player class.
Definition: player.cpp:29
void heal()
Definition: player.cpp:305
std::vector< int > getNum()
Definition: player.cpp:188
void removeBuff(std::string buff)
Remove a buff from the player.
Definition: player.cpp:175
Manages player attributes and actions.
Definition: player.h:20
std::vector< std::string > getBuffs()
Get the player&#39;s active buffs.
Definition: player.cpp:260
Player()
Constructor for the Player class.
Definition: player.cpp:15
int getCoins()
Definition: player.cpp:357