Emergency 20 Dokumentation  4.2.0
qsf::GameLogic Class Reference

Game logic base class. More...

#include <GameLogic.h>

Inheritance diagram for qsf::GameLogic:
qsf::WeakPtrTarget em5::BaseTreatmentLogic em5::BoatLogic em5::CarryPersonLogic em5::Cleanup em5::CommandoCarLogic em5::DLKLogic em5::DroneTransportLogic em5::EngineerLogic em5::EvadePlayerUnitsLogic em5::FireDroneLogic em5::FleeFromFireLogic em5::FollowedByHelicopterLogic em5::FollowMagnetLogic em5::GangsterBaseLogic em5::GangsterInBuildingLogic em5::MotorboatTransporterLogic em5::Observer em5::PersonInBuildingLogic em5::PersonJumpOutOfWindowLogic em5::PoliceVehicleLogic em5::PullObjectLogic em5::RabidDogLogic em5::ReserveLogic em5::SEKRobotLogic em5::TowcarLogic em5::UseObjectLogic em5::VehicleExtinguishLogic

Public Member Functions

virtual ~GameLogic ()
 Destructor. More...
 
uint32 getId () const
 Get the game logic's unique ID. More...
 
uint32 getTypeId () const
 Get the game logic's type ID. More...
 
uint64 getEntityId () const
 Get the owning entity's ID or zero if there is none. More...
 
EntitygetEntity () const
 Get the owning entity or a null pointer if there is none. More...
 
EntitygetEntitySafe () const
 Get the owning entity or a null pointer if there is none. More...
 
MapgetMap () const
 Get the associated map of the game logic. More...
 
bool startup ()
 Startup the game logic. More...
 
bool isRunning () const
 Return whether or not the game logic is up-and-running. More...
 
void shutdown ()
 Shutdown the game logic. More...
 
bool isDebug () const
 Return whether or not the logic is considered to be in debug mode. More...
 
void setDebug (bool debugMode)
 Set whether or not the logic is considered to be in debug mode. More...
 
virtual bool onStartup ()
 Startup the game logic. More...
 
virtual void onShutdown ()
 Shutdown the game logic. More...
 
virtual void serialize (BinarySerializer &serializer)
 Serialize or deserialize the game logic using a binary serializer. More...
 

Protected Member Functions

virtual void onSetDebug (bool debug)
 Set whether or not the logic is considered to be in debug mode. More...
 
void removeThis ()
 
 GameLogic (uint32 typeId)
 Constructor. More...
 
void registrationAtManager (GameLogicManager &manager, uint32 id)
 Registering call from manager. More...
 
- Protected Member Functions inherited from qsf::WeakPtrTarget
 WeakPtrTarget ()
 Default constructor. More...
 
 WeakPtrTarget (const WeakPtrTarget &other)
 Copy constructor. More...
 
 WeakPtrTarget (WeakPtrTarget &&)=delete
 Delete the move constructor, as WeakPtrTarget would need a proper move constructor-implementation that ensures that its pointer gets updated in the WeakPtrBase as well. More...
 
 ~WeakPtrTarget ()
 Destructor. More...
 
void invalidateAllWeakPtr ()
 Invalidate all weak pointers to this object. More...
 
void operator= (const WeakPtrTarget &other)
 Copy operator. More...
 

Friends

class GameLogicManager
 
class GameLogicComponent
 

Detailed Description

Game logic base class.

Constructor & Destructor Documentation

qsf::GameLogic::~GameLogic ( )
inlinevirtual

Destructor.

qsf::GameLogic::GameLogic ( uint32  typeId)
inlineprotected

Constructor.

Member Function Documentation

Entity* qsf::GameLogic::getEntity ( ) const

Get the owning entity or a null pointer if there is none.

uint64 qsf::GameLogic::getEntityId ( ) const
inline

Get the owning entity's ID or zero if there is none.

Entity& qsf::GameLogic::getEntitySafe ( ) const

Get the owning entity or a null pointer if there is none.

uint32 qsf::GameLogic::getId ( ) const
inline

Get the game logic's unique ID.

Map& qsf::GameLogic::getMap ( ) const

Get the associated map of the game logic.

uint32 qsf::GameLogic::getTypeId ( ) const
inline

Get the game logic's type ID.

bool qsf::GameLogic::isDebug ( ) const
inline

Return whether or not the logic is considered to be in debug mode.

Returns
"true" if the logic is considered to be in debug mode, else "false"
Note
  • The default implementation always returns "false"
  • Not connected to the CAMP reflection system by intent, this should be internal only
bool qsf::GameLogic::isRunning ( ) const
inline

Return whether or not the game logic is up-and-running.

Returns
"true" if the game logic is up-and-running ("onStartup()" was called successfully), else "false"
void qsf::GameLogic::onSetDebug ( bool  debug)
inlineprotectedvirtual

Set whether or not the logic is considered to be in debug mode.

Parameters
[in]debug"true" if the logic is considered to be in debug mode, else "false"
Note
  • The default implementation is empty
  • This method is only called in case there's a real state change
See also
  • "qsf::Component::setDebug()"

Reimplemented in em5::FiremanLogic.

void qsf::GameLogic::onShutdown ( )
inlinevirtual

Shutdown the game logic.

Reimplemented in em5::GangsterBaseLogic, em5::FiremanLogic, em5::HintMessageGeneralObserver, em5::MessageObjectiveGeneralObserver, em5::MessageObserver, em5::DLKLogic, em5::PullObjectLogic, em5::MessageObjectiveObserver, em5::DoctorLogic, em5::EvadePlayerUnitsLogic, em5::PersonDiedObserver, em5::PersonInjuredObserver, em5::BaseTreatmentLogic, em5::Observer, em5::CommandoCarLogic, em5::RescueDogLeaderLogic, em5::SEKRobotLogic, em5::HealPersonObserver, em5::PersonDiedGeneralObserver, em5::DecontaminatePersonObserver, em5::ExtinguishFireObserver, em5::PersonInjuredGeneralObserver, em5::PlagueQuicktestObserver, em5::RestartFireObserver, em5::DestroyedByFireObserver, em5::FlyingHeliPlacedPersonObserver, em5::TookHostageOutsideObserver, em5::PersonInWindowObserver, em5::RescueDogFoundPersonObserver, em5::RescueDrowningPersonObserver, em5::TookGangsterOutsideObserver, em5::UnhideBuriedObserver, em5::DroneTransportLogic, em5::PolicemanLogic, em5::CoolingObserver, em5::HintLowEnergyObserver, em5::PersonInBuildingLogic, em5::HintVehicleDamagedGeneralObserver, em5::Cleanup, em5::ParkingVehicleCleanup, em5::CarryPersonLogic, em5::VehicleDamagedGeneralObserver, em5::FollowMagnetLogic, em5::PersonJumpOutOfWindowLogic, em5::HintInjuredGeneralObserver, em5::FireDroneLogic, em5::VehicleExtinguishLogic, em5::HintInfectedGeneralObserver, em5::GangsterInBuildingLogic, em5::MultiMessageObserver, em5::HintInjuredObserver, em5::HintPoliceLeftVehicleObserver, em5::HintShotAtObserver, em5::RabidDogLogic, em5::DiverLogic, em5::ParamedicLogic, em5::EngineerLogic, em5::FleeFromFireLogic, em5::FollowedByHelicopterLogic, em5::GangsterCarHijackerLogic, em5::MotorboatTransporterLogic, em5::GangsterFanaticArsonistLogic, em5::BoatLogic, em5::PoliceVehicleLogic, em5::TowcarLogic, and em5::SEKSpecialistLogic.

bool qsf::GameLogic::onStartup ( )
inlinevirtual

Startup the game logic.

Reimplemented in em5::GangsterBaseLogic, em5::FiremanLogic, em5::HintMessageGeneralObserver, em5::MessageObjectiveGeneralObserver, em5::MessageObserver, em5::DLKLogic, em5::PullObjectLogic, em5::MessageObjectiveObserver, em5::DoctorLogic, em5::EvadePlayerUnitsLogic, em5::PersonDiedObserver, em5::PersonInjuredObserver, em5::BaseTreatmentLogic, em5::CommandoCarLogic, em5::RescueDogLeaderLogic, em5::SEKRobotLogic, em5::HealPersonObserver, em5::PersonDiedGeneralObserver, em5::Observer, em5::DecontaminatePersonObserver, em5::ExtinguishFireObserver, em5::PersonInjuredGeneralObserver, em5::PlagueQuicktestObserver, em5::RestartFireObserver, em5::DestroyedByFireObserver, em5::FlyingHeliPlacedPersonObserver, em5::TookHostageOutsideObserver, em5::PersonInWindowObserver, em5::RescueDogFoundPersonObserver, em5::RescueDrowningPersonObserver, em5::TookGangsterOutsideObserver, em5::UnhideBuriedObserver, em5::DroneTransportLogic, em5::PolicemanLogic, em5::CoolingObserver, em5::HintLowEnergyObserver, em5::PersonInBuildingLogic, em5::HintVehicleDamagedGeneralObserver, em5::Cleanup, em5::ParkingVehicleCleanup, em5::CarryPersonLogic, em5::VehicleDamagedGeneralObserver, em5::FollowMagnetLogic, em5::PersonJumpOutOfWindowLogic, em5::HintInjuredGeneralObserver, em5::FireDroneLogic, em5::VehicleExtinguishLogic, em5::HintInfectedGeneralObserver, em5::GangsterInBuildingLogic, em5::MultiMessageObserver, em5::HintInjuredObserver, em5::HintPoliceLeftVehicleObserver, em5::HintShotAtObserver, em5::RabidDogLogic, em5::DiverLogic, em5::ParamedicLogic, em5::GangsterME301Arsonist, em5::EngineerLogic, em5::FleeFromFireLogic, em5::FollowedByHelicopterLogic, em5::GangsterCarHijackerLogic, em5::GangsterGuardPassageLogic, em5::MotorboatTransporterLogic, em5::GangsterFanaticArsonistLogic, em5::BoatLogic, em5::GangsterDemoArsonist, em5::PoliceVehicleLogic, em5::TowcarLogic, em5::GangsterME308FactoryBoss, and em5::SEKSpecialistLogic.

void qsf::GameLogic::registrationAtManager ( GameLogicManager manager,
uint32  id 
)
inlineprotected

Registering call from manager.

void qsf::GameLogic::removeThis ( )
protected
void qsf::GameLogic::setDebug ( bool  debugMode)

Set whether or not the logic is considered to be in debug mode.

Parameters
[in]debugMode"true" if the logic is considered to be in debug mode, else "false"
Remarks
The semantic of "debug mode" depends of the logic. An implementation is free to ignore the request or do nothing at all because a debug mode state makes no sense for the logic.
Note
  • The default implementation is empty
  • Not connected to the CAMP reflection system by intent, this should be internal only
void qsf::GameLogic::shutdown ( )

Shutdown the game logic.

bool qsf::GameLogic::startup ( )

Startup the game logic.

Returns
"true" if all went fine, else "false"

Friends And Related Function Documentation

friend class GameLogicComponent
friend
friend class GameLogicManager
friend

The documentation for this class was generated from the following files: