Emergency 20 Dokumentation  4.2.0
em5::Observer Class Reference

EMERGENCY 5 observer base class. More...

#include <Observer.h>

Inheritance diagram for em5::Observer:
qsf::GameLogic qsf::WeakPtrTarget em5::CoolingObserver em5::DecontaminatePersonObserver em5::DestroyedByFireObserver em5::ExtinguishFireObserver em5::FlyingHeliPlacedPersonObserver em5::HealPersonObserver em5::HintInfectedGeneralObserver em5::HintInjuredGeneralObserver em5::HintInjuredObserver em5::HintLowEnergyObserver em5::HintMessageGeneralObserver em5::HintPoliceLeftVehicleObserver em5::HintShotAtObserver em5::HintVehicleDamagedGeneralObserver em5::MessageObjectiveGeneralObserver em5::MessageObjectiveObserver em5::MessageObserver em5::MultiMessageObserver em5::PersonDiedGeneralObserver em5::PersonDiedObserver em5::PersonInjuredGeneralObserver em5::PersonInjuredObserver em5::PersonInWindowObserver em5::PlagueQuicktestObserver em5::RescueDogFoundPersonObserver em5::RescueDrowningPersonObserver em5::RestartFireObserver em5::TookGangsterOutsideObserver em5::TookHostageOutsideObserver em5::UnhideBuriedObserver em5::VehicleDamagedGeneralObserver

Public Member Functions

virtual ~Observer ()
 Destructor. More...
 
const std::string & getName () const
 Get the observer's name. More...
 
void setName (const std::string &name)
 Set the observer's name; the name has no special meaning internally, use it as you like, e.g. to identify a single observer. More...
 
virtual bool onStartup () override
 Start up the game logic. More...
 
virtual void onShutdown () override
 Shut down the game logic. More...
 
- Public Member Functions inherited from qsf::GameLogic
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 void serialize (BinarySerializer &serializer)
 Serialize or deserialize the game logic using a binary serializer. More...
 

Protected Member Functions

 Observer (uint32 typeId)
 Constructor. More...
 
FreeplayEventgetParentEvent () const
 Get parent event. More...
 
template<typename T >
T & createObserver (uint64 entityId)
 Create observer. More...
 
template<typename T >
T * getObserver (uint64 entityId)
 Get observer. More...
 
- Protected Member Functions inherited from qsf::GameLogic
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 FreeplayEvent
 

Detailed Description

EMERGENCY 5 observer base class.

Constructor & Destructor Documentation

virtual em5::Observer::~Observer ( )
virtual

Destructor.

em5::Observer::Observer ( uint32  typeId)
explicitprotected

Constructor.

Member Function Documentation

template<typename T >
T & em5::Observer::createObserver ( uint64  entityId)
protected

Create observer.

const std::string & em5::Observer::getName ( ) const
inline

Get the observer's name.

template<typename T >
T * em5::Observer::getObserver ( uint64  entityId)
protected

Get observer.

FreeplayEvent* em5::Observer::getParentEvent ( ) const
protected

Get parent event.

void em5::Observer::setName ( const std::string &  name)
inline

Set the observer's name; the name has no special meaning internally, use it as you like, e.g. to identify a single observer.

Friends And Related Function Documentation

friend class FreeplayEvent
friend

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