TheCOSCGameProject  1.0
enemies.h
Go to the documentation of this file.
1 
8 #ifndef ENEMIES_H
9 #define ENEMIES_H
10 
11 #include <string>
12 
19 struct Enemy
20 {
21  std::string name;
22  int health;
23  int attack;
24  std::string type;
25  std::string personality;
26  int defence;
27 };
28 
36 {
37 public:
42  EnemySpawner();
43 
48  Enemy spawnEnemy();
49 
55  int getHealth(const Enemy &enemy);
56 
62  int getAttack(const Enemy &enemy);
63 
69  std::string getName(const Enemy &enemy);
70 
76  std::string getType(const Enemy &enemy);
77 
83  std::string getPersonality(const Enemy &enemy);
84 
90  int getDefence(const Enemy &enemy);
91 
97  bool isDead(const Enemy &enemy);
98 
104  void damageDelt(Enemy &enemy, int hurt);
105 
111  void setAttack(Enemy &enemy, int attack);
112 
118  void setHealth(Enemy &enemy, int health);
119 
120 private:
125  std::string generateName();
126 
131  int generateHealth();
132 
137  int generateAttack();
138 
143  std::string generateType();
144 
149  std::string generatePersonality();
150 
155  int generateDefence();
156 };
157 
158 #endif // ENEMIES_H
Represents an enemy character in the game.
Definition: enemies.h:19
int attack
The attack power of the enemy.
Definition: enemies.h:23
int defence
The defense value of the enemy.
Definition: enemies.h:26
int health
The health points of the enemy.
Definition: enemies.h:22
std::string type
The type or category of the enemy.
Definition: enemies.h:24
std::string name
The name of the enemy.
Definition: enemies.h:21
Responsible for spawning enemies in the game.
Definition: enemies.h:35
std::string personality
The personality trait of the enemy.
Definition: enemies.h:25