Mostly working spatical map with 2 level collision/space structure. Not the best implementation but this is the idea.
This commit is contained in:
parent
fd53f92fe6
commit
d6326c9e41
7 changed files with 60 additions and 31 deletions
|
@ -20,11 +20,14 @@ class SpatialMap {
|
|||
public:
|
||||
SpatialMap() {}
|
||||
PointEntityMap yes_collision;
|
||||
PointEntityMap no_collision;
|
||||
|
||||
void insert(Point pos, DinkyECS::Entity obj);
|
||||
void insert(Point pos, DinkyECS::Entity obj, bool has_collision);
|
||||
void move(Point from, Point to, DinkyECS::Entity ent);
|
||||
void remove(Point pos);
|
||||
// return value is whether the removed thing has collision
|
||||
bool remove(Point pos);
|
||||
bool occupied(Point pos) const;
|
||||
bool something_there(Point at) const;
|
||||
DinkyECS::Entity get(Point at) const;
|
||||
FoundEntities neighbors(Point position, bool diag=false) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue