metaforce/Runtime/GameObjectLists.cpp

55 lines
2.1 KiB
C++
Raw Permalink Normal View History

#include "Runtime/GameObjectLists.hpp"
#include "Runtime/Camera/CGameCamera.hpp"
#include "Runtime/World/CGameLight.hpp"
#include "Runtime/World/CPatterned.hpp"
#include "Runtime/World/CScriptAiJumpPoint.hpp"
#include "Runtime/World/CScriptCoverPoint.hpp"
#include "Runtime/World/CScriptDoor.hpp"
#include "Runtime/World/CScriptPlatform.hpp"
#include "TCastTo.hpp" // Generated file, do not modify include path
2021-04-10 01:42:06 -07:00
namespace metaforce {
2018-12-07 21:30:43 -08:00
CActorList::CActorList() : CObjectList(EGameObjectList::Actor) {}
bool CActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CActor>(ent).IsValid(); }
2018-12-07 21:30:43 -08:00
CPhysicsActorList::CPhysicsActorList() : CObjectList(EGameObjectList::PhysicsActor) {}
bool CPhysicsActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CPhysicsActor>(ent).IsValid(); }
2018-12-07 21:30:43 -08:00
CGameCameraList::CGameCameraList() : CObjectList(EGameObjectList::GameCamera) {}
bool CGameCameraList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CGameCamera>(ent).IsValid(); }
2018-12-07 21:30:43 -08:00
CListeningAiList::CListeningAiList() : CObjectList(EGameObjectList::ListeningAi) {}
bool CListeningAiList::IsQualified(const CEntity& ent) const {
const TCastToConstPtr<CPatterned> ai(ent);
2018-12-07 21:30:43 -08:00
return ai && ai->IsListening();
}
2018-12-07 21:30:43 -08:00
CAiWaypointList::CAiWaypointList() : CObjectList(EGameObjectList::AiWaypoint) {}
bool CAiWaypointList::IsQualified(const CEntity& ent) const {
2018-12-07 21:30:43 -08:00
return TCastToConstPtr<CScriptCoverPoint>(ent) || TCastToConstPtr<CScriptAiJumpPoint>(ent);
}
2018-12-07 21:30:43 -08:00
CPlatformAndDoorList::CPlatformAndDoorList() : CObjectList(EGameObjectList::PlatformAndDoor) {}
bool CPlatformAndDoorList::IsQualified(const CEntity& ent) const { return IsDoor(ent) || IsPlatform(ent); }
bool CPlatformAndDoorList::IsDoor(const CEntity& ent) const { return TCastToConstPtr<CScriptDoor>(ent).IsValid(); }
bool CPlatformAndDoorList::IsPlatform(const CEntity& ent) const {
return TCastToConstPtr<CScriptPlatform>(ent).IsValid();
}
2018-12-07 21:30:43 -08:00
CGameLightList::CGameLightList() : CObjectList(EGameObjectList::GameLight) {}
bool CGameLightList::IsQualified(const CEntity& lt) const { return TCastToConstPtr<CGameLight>(lt).IsValid(); }
2021-04-10 01:42:06 -07:00
} // namespace metaforce