summaryrefslogtreecommitdiff
path: root/src/common.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.hpp')
-rw-r--r--src/common.hpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/common.hpp b/src/common.hpp
index f543ca5..eaed590 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -129,7 +129,6 @@ namespace world {
};
class entity_t {
- world_t *parent_world;
std::vector<sector_t*> parents;
void link_to_sector(sector_t *sector);
@@ -139,12 +138,14 @@ namespace world {
size_t cookie = 0;
public:
+ world_t *world = 0;
int type;
cmodel_t cmodel;
rectf_t render_bounds;
int render_layer = 0;
entity_t(int type_);
+ ~entity_t(void) {};
void link(world_t *world);
void unlink();
@@ -189,6 +190,7 @@ namespace interface {
namespace game {
bool load_assets(void);
+ class entity_t;
class unit_t;
class effect_t;
@@ -203,11 +205,11 @@ namespace game {
};
class state_t {
- std::unordered_set<unit_t*> units;
- std::unordered_set<unit_t*> selected_units;
- std::unordered_set<unit_t*> awake_units;
+ protected:
+ friend entity_t;
- std::unordered_set<effect_t*> effects;
+ std::unordered_set<entity_t*> awake_entities;
+ std::unordered_set<unit_t*> selected_units;
procgen::prng_t dice_prng;
public:
@@ -225,7 +227,7 @@ namespace game {
size_t roll(roll_params_t *P);
- void add_effect(effect_t *effect);
+ void wake_everything(v2f_t x, float range);
};
}