2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 22:27:43 +00:00

MkCastTo: Make operator bool instances explicit

Prevents error prone implicit conversions.
This commit is contained in:
Lioncash
2020-04-17 13:29:20 -04:00
parent 8f5caca1e5
commit 2c3e5e205f
4 changed files with 15 additions and 11 deletions

View File

@@ -14,15 +14,15 @@ namespace urde {
CActorList::CActorList() : CObjectList(EGameObjectList::Actor) {}
bool CActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CActor>(ent); }
bool CActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CActor>(ent).IsValid(); }
CPhysicsActorList::CPhysicsActorList() : CObjectList(EGameObjectList::PhysicsActor) {}
bool CPhysicsActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CPhysicsActor>(ent); }
bool CPhysicsActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CPhysicsActor>(ent).IsValid(); }
CGameCameraList::CGameCameraList() : CObjectList(EGameObjectList::GameCamera) {}
bool CGameCameraList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CGameCamera>(ent); }
bool CGameCameraList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CGameCamera>(ent).IsValid(); }
CListeningAiList::CListeningAiList() : CObjectList(EGameObjectList::ListeningAi) {}
@@ -41,12 +41,14 @@ CPlatformAndDoorList::CPlatformAndDoorList() : CObjectList(EGameObjectList::Plat
bool CPlatformAndDoorList::IsQualified(const CEntity& ent) const { return IsDoor(ent) || IsPlatform(ent); }
bool CPlatformAndDoorList::IsDoor(const CEntity& ent) const { return TCastToConstPtr<CScriptDoor>(ent); }
bool CPlatformAndDoorList::IsDoor(const CEntity& ent) const { return TCastToConstPtr<CScriptDoor>(ent).IsValid(); }
bool CPlatformAndDoorList::IsPlatform(const CEntity& ent) const { return TCastToConstPtr<CScriptPlatform>(ent); }
bool CPlatformAndDoorList::IsPlatform(const CEntity& ent) const {
return TCastToConstPtr<CScriptPlatform>(ent).IsValid();
}
CGameLightList::CGameLightList() : CObjectList(EGameObjectList::GameLight) {}
bool CGameLightList::IsQualified(const CEntity& lt) const { return TCastToConstPtr<CGameLight>(lt); }
bool CGameLightList::IsQualified(const CEntity& lt) const { return TCastToConstPtr<CGameLight>(lt).IsValid(); }
} // namespace urde