game2004/server/gameserver/moveableentity.h
aozhiwei e9055b5e49 1
2020-05-30 20:20:06 +08:00

24 lines
663 B
C++

#pragma once
#include "gridservice.h"
#include "roomentity.h"
class MoveableEntity : public RoomEntity
{
public:
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);
protected:
int updated_times_ = 0;
private:
std::set<GridCell*> grid_list_;
};