35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "gridservice.h"
|
|
#include "roomentity.h"
|
|
|
|
class AIComponent;
|
|
class MoveableEntity : public RoomEntity
|
|
{
|
|
public:
|
|
a8::Vec2 move_dir;
|
|
AIComponent* ai = nullptr;
|
|
|
|
virtual void Update(int delta_time) {};
|
|
int UpdatedTimes() { return updated_times_;}
|
|
std::set<GridCell*>& GetGridList() { return grid_list_; }
|
|
|
|
void TouchLayer0EntityList(std::function<void (Entity*, bool&)> func);
|
|
void TouchLayer1EntityList(std::function<void (Entity*, bool&)> func);
|
|
void TouchAllLayerEntityList(std::function<void (Entity*, bool&)> func);
|
|
void TouchAllLayerHumanList(std::function<void (Human*, bool&)> func);
|
|
|
|
virtual void RefreshView();
|
|
virtual void OnGridListChange(std::set<GridCell*>& old_grids,
|
|
std::set<GridCell*>& inc_grids,
|
|
std::set<GridCell*>& dec_grids
|
|
);
|
|
virtual void SyncAroundPlayers(const char* file, int line, const char* func);
|
|
|
|
protected:
|
|
int updated_times_ = 0;
|
|
|
|
private:
|
|
std::set<GridCell*> grid_list_;
|
|
};
|