This commit is contained in:
aozhiwei 2021-06-17 20:52:06 +08:00
parent 32ccefbed8
commit 43131cb5d4
4 changed files with 8 additions and 8 deletions

View File

@ -1187,13 +1187,6 @@ bool Creature::IsEnemy(Creature* target)
}
}
void Creature::TraverseCreatures(std::function<void (Creature*, bool&)> func)
{
room->grid_service->TraverseCreatures(room->GetRoomIdx(),
GetGridList(),
func);
}
void Creature::TraverseProperTargets(std::function<void (Creature*, bool&)> func)
{
auto callback =

View File

@ -151,7 +151,6 @@ class Creature : public MoveableEntity
int GetActionType() { return action_type; }
int GetActionTargetId() { return action_target_id; }
void TraverseCreatures(std::function<void (Creature*, bool&)> func);
void TraverseProperTargets(std::function<void (Creature*, bool&)> func);
void TraverseProperTargetsNoTeammate(std::function<void (Creature*, bool&)> func);
CreatureWeakPtrChunk* GetWeakPtrChunk() { return &weak_ptr_chunk_; };

View File

@ -63,3 +63,10 @@ void MoveableEntity::SyncAroundPlayers(const char* file, int line, const char* f
hum->AddToNewObjects(this);
});
}
void MoveableEntity::TraverseCreatures(std::function<void (Creature*, bool&)> func)
{
room->grid_service->TraverseCreatures(room->GetRoomIdx(),
GetGridList(),
func);
}

View File

@ -13,6 +13,7 @@ class MoveableEntity : public RoomEntity
int UpdatedTimes() { return updated_times_;}
std::set<GridCell*>& GetGridList() { return grid_list_; }
void TraverseCreatures(std::function<void (Creature*, bool&)> func);
void TraverseAllLayerEntityList(std::function<void (Entity*, bool&)> func);
void TraverseAllLayerHumanList(std::function<void (Human*, bool&)> func);