Tower Defence 2
enemy.h
1 #ifndef TOWER_DEFENCE_2_ENEMY_H
2 #define TOWER_DEFENCE_2_ENEMY_H
3 
4 #include "object.h"
5 #include <string>
6 
7 
8 // Deferred declaration
9 class EnemyType;
10 
12 class Enemy : public Object {
13 public:
14  Enemy(double x, double y, double radius, double speed, int health,
15  EnemyType *enemy_type);
16  ~Enemy();
17 
18  std::string name() const;
19  int score() const;
20  int money() const;
21 
22 private:
23  EnemyType *m_enemy_type;
24 };
25 
27 class EnemyType {
28 public:
29  EnemyType(const std::string &name, int score, int money, double speed,
30  int health);
31 
32  ~EnemyType();
33 
34  int score() const;
35  int money() const;
36  std::string name() const;
37 
39  Enemy * create_enemy(double x, double y);
40 
41 private:
43  const std::string m_name;
44 
46  const int m_score;
47 
49  const int m_money;
50 
51  // Initial values for new enemies
52  const double m_speed;
53  const int m_health;
54 };
55 
56 
57 #endif //TOWER_DEFENCE_2_ENEMY_H
Definition: object.h:19
int m_health
Current health of the object.
Definition: object.h:83
Enemy class.
Definition: enemy.h:12
double m_speed
Current speed of the object.
Definition: object.h:77
Description for creating new enemies.
Definition: enemy.h:27