mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 05:47:42 +00:00
CObjectList: Make IsQualified() a const member function
None of the implementations modify object instance state, so this can be made const qualified.
This commit is contained in:
@@ -14,39 +14,39 @@ namespace urde {
|
||||
|
||||
CActorList::CActorList() : CObjectList(EGameObjectList::Actor) {}
|
||||
|
||||
bool CActorList::IsQualified(const CEntity& ent) { return TCastToConstPtr<CActor>(ent); }
|
||||
bool CActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CActor>(ent); }
|
||||
|
||||
CPhysicsActorList::CPhysicsActorList() : CObjectList(EGameObjectList::PhysicsActor) {}
|
||||
|
||||
bool CPhysicsActorList::IsQualified(const CEntity& ent) { return TCastToConstPtr<CPhysicsActor>(ent); }
|
||||
bool CPhysicsActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CPhysicsActor>(ent); }
|
||||
|
||||
CGameCameraList::CGameCameraList() : CObjectList(EGameObjectList::GameCamera) {}
|
||||
|
||||
bool CGameCameraList::IsQualified(const CEntity& ent) { return TCastToConstPtr<CGameCamera>(ent); }
|
||||
bool CGameCameraList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CGameCamera>(ent); }
|
||||
|
||||
CListeningAiList::CListeningAiList() : CObjectList(EGameObjectList::ListeningAi) {}
|
||||
|
||||
bool CListeningAiList::IsQualified(const CEntity& ent) {
|
||||
TCastToConstPtr<CAi> ai(ent);
|
||||
bool CListeningAiList::IsQualified(const CEntity& ent) const {
|
||||
const TCastToConstPtr<CAi> ai(ent);
|
||||
return ai && ai->IsListening();
|
||||
}
|
||||
|
||||
CAiWaypointList::CAiWaypointList() : CObjectList(EGameObjectList::AiWaypoint) {}
|
||||
|
||||
bool CAiWaypointList::IsQualified(const CEntity& ent) {
|
||||
bool CAiWaypointList::IsQualified(const CEntity& ent) const {
|
||||
return TCastToConstPtr<CScriptCoverPoint>(ent) || TCastToConstPtr<CScriptAiJumpPoint>(ent);
|
||||
}
|
||||
|
||||
CPlatformAndDoorList::CPlatformAndDoorList() : CObjectList(EGameObjectList::PlatformAndDoor) {}
|
||||
|
||||
bool CPlatformAndDoorList::IsQualified(const CEntity& ent) { return IsDoor(ent) || IsPlatform(ent); }
|
||||
bool CPlatformAndDoorList::IsQualified(const CEntity& ent) const { return IsDoor(ent) || IsPlatform(ent); }
|
||||
|
||||
bool CPlatformAndDoorList::IsDoor(const CEntity& ent) { return TCastToConstPtr<CScriptDoor>(ent); }
|
||||
bool CPlatformAndDoorList::IsDoor(const CEntity& ent) const { return TCastToConstPtr<CScriptDoor>(ent); }
|
||||
|
||||
bool CPlatformAndDoorList::IsPlatform(const CEntity& ent) { return TCastToConstPtr<CScriptPlatform>(ent); }
|
||||
bool CPlatformAndDoorList::IsPlatform(const CEntity& ent) const { return TCastToConstPtr<CScriptPlatform>(ent); }
|
||||
|
||||
CGameLightList::CGameLightList() : CObjectList(EGameObjectList::GameLight) {}
|
||||
|
||||
bool CGameLightList::IsQualified(const CEntity& lt) { return TCastToConstPtr<CGameLight>(lt); }
|
||||
bool CGameLightList::IsQualified(const CEntity& lt) const { return TCastToConstPtr<CGameLight>(lt); }
|
||||
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user