46 lines
1.4 KiB
C++
46 lines
1.4 KiB
C++
#pragma once
|
|
|
|
class Entity;
|
|
class Human;
|
|
class Bullet;
|
|
class Room;
|
|
class Creature;
|
|
|
|
class GridCell
|
|
{
|
|
public:
|
|
|
|
GridCell();
|
|
void ClearRoomData(Room* room);
|
|
|
|
void TraverseHumanList(std::function<void (Human*, bool&)> func,
|
|
int room_idx,
|
|
bool& stop);
|
|
void TraverseCreatures(std::function<void (Creature*, bool&)>& func,
|
|
int room_idx,
|
|
bool& stop);
|
|
|
|
void AddCreature(Creature* c);
|
|
void RemoveCreature(Creature* c);
|
|
bool CreatureExists(Creature* c);
|
|
void AddBullet(Bullet* bullet);
|
|
void RemoveBullet(Bullet* bullet);
|
|
void AddPermanentEntity(Entity* entity);
|
|
void AddRoomEntity(Room* room, Entity* entity);
|
|
void RemoveRoomEntity(Room* room, Entity* entity);
|
|
bool EntityExists(Room* room, Entity* Entity);
|
|
void TraverseLayer0EntityList(std::function<void (Entity*, bool&)>& func,
|
|
bool& stop);
|
|
void TraverseLayer1EntityList(std::function<void (Entity*, bool&)>& func,
|
|
int room_idx,
|
|
bool& stop);
|
|
void TraverseAllLayerEntityList(std::function<void (Entity*, bool&)>& func,
|
|
int room_idx,
|
|
bool& stop);
|
|
|
|
private:
|
|
std::vector<std::set<Entity*>*> entitys_;
|
|
std::vector<std::set<Bullet*>*> bullets_;
|
|
std::vector<std::set<Creature*>*> creatures_;
|
|
};
|