summaryrefslogtreecommitdiff
path: root/src/game/game.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/game.hpp')
-rw-r--r--src/game/game.hpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/game/game.hpp b/src/game/game.hpp
index f45aecf..f141e85 100644
--- a/src/game/game.hpp
+++ b/src/game/game.hpp
@@ -45,7 +45,14 @@ namespace game {
world::cflags_t cflags;
size_t selected = 0;
- unit_t();
+ typedef enum {
+ UNIT_HUMAN,
+ UNIT_ALIEN
+ } type_t;
+
+ type_t type;
+
+ unit_t(type_t type_);
struct {
bool moving = false;
@@ -62,23 +69,39 @@ namespace game {
const wchar_t *say_text;
double say_time = -INFINITY;
+ bool awake = false;
+ double wake_time = -INFINITY;
+
void render_to(render::state_t *render);
void say(const wchar_t *wstr, double now);
void place(world::world_t *world_, v2f_t x_);
- bool keep_moving(double now, double dt);
+ bool keep_moving(double now, double dt, double speed);
bool start_moving(v2f_t dst_, double now);
+
+ virtual void wake(double now, unit_t *by_whom) = 0;
+ virtual void sleep(double now) = 0;
+ virtual void think(double now, double dt) = 0;
};
class human_t : public unit_t {
public:
human_t();
void render_to(render::state_t *render);
- bool keep_moving(double now, double dt);
+
+ void wake(double now, unit_t *by_whom);
+ void sleep(double now);
+ void think(double now, double dt);
};
class alien_t : public unit_t {
+ unit_t *target;
+
public:
alien_t();
void render_to(render::state_t *render);
+
+ void wake(double now, unit_t *by_whom);
+ void sleep(double now);
+ void think(double now, double dt);
};
};