Roguelike
 All Classes Namespaces Functions Variables Typedefs Friends Pages
spawner.h
1 
22 #ifndef SPAWNER_H
23 #define SPAWNER_H
24 #include <enemy.h>
25 #include <ctime>
26 #include <iostream>
27 #include <defs.h>
28 
35 class Spawner
36 {
37  protected:
41  int x;
42 
46  int y;
47 
51  int depth;
52 
57 
58  public:
59  /*
60  * The default constructor.
61  */
62  Spawner();
63 
64  /*
65  * The constructor for the spanwer.
66  */
67  Spawner(int, int, int, EnemyType);
68 
69  /*
70  * Determines whether or not an enemy should spawn.
71  * Currently based entireliy on a 1/100 random chance of spawning/
72  game tick.
73  * \todo Make this more complex based on enemy type and other factors.
74  * @return Bool depending on whether or not an enemy should spawn.
75  */
76  bool should_spawn();
83  Enemy* spawn_creep(int chunk_x, int chunk_y);
84 
88  int get_x();
89 
93  int get_y();
94 
98  int get_depth();
99 };
100 
101 #endif
102 
int get_x()
Definition: spawner.cpp:46
Definition: enemy.h:100
int depth
Definition: spawner.h:51
Definition: defs.h:565
EnemyType enemy
Definition: spawner.h:56
Enemy * spawn_creep(int chunk_x, int chunk_y)
Definition: spawner.cpp:41
int y
Definition: spawner.h:46
int x
Definition: spawner.h:41
int get_y()
Definition: spawner.cpp:51
int get_depth()
Definition: spawner.cpp:56
Definition: spawner.h:35