Emergency 20 Dokumentation  4.2.0
em5::MessageObjectiveGeneralObserver Class Reference

EMERGENCY 5 general observer logic that reacts on a given message configuration. More...

#include <MessageObjectiveGeneralObserver.h>

Inheritance diagram for em5::MessageObjectiveGeneralObserver:
em5::Observer qsf::GameLogic qsf::WeakPtrTarget

Public Types

enum  ObserverReactionType {
  REACTION_NONE, REACTION_DEC_CURRENT_NUMBER, REACTION_INC_CURRENT_NUMBER, REACTION_DEC_NEEDED_NUMBER,
  REACTION_INC_NEEDED_NUMBER
}
 

Public Member Functions

 MessageObjectiveGeneralObserver ()
 Default constructor. More...
 
void registerMessage (const qsf::MessageConfiguration &configuration)
 Register the message proxy if the target entity is the containing entity. More...
 
void registerMessage (const qsf::MessageConfiguration &configuration, uint32 entityIdFilter)
 Register the message proxy if the target entities have their ID in the filters. More...
 
void registerMessage (const qsf::MessageConfiguration &configuration, std::string entityIdParameter)
 Register the message proxy if the target entities have their ID in the parameters. More...
 
void connectToObjective (Objective &objective, ObserverReactionType observerReaction)
 Connect this observer to an objective to be informed when an infected person was healed. More...
 
virtual bool onStartup () override
 Start up the game logic. More...
 
virtual void onShutdown () override
 Shut down the game logic. More...
 
virtual void serialize (qsf::BinarySerializer &serializer) override
 Serialize or deserialize the game logic using a binary serializer. More...
 
- Public Member Functions inherited from em5::Observer
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...
 
- 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...
 

Static Public Attributes

static const uint32 GAMELOGIC_TYPE_ID
 

Additional Inherited Members

- Protected Member Functions inherited from em5::Observer
 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...
 

Detailed Description

EMERGENCY 5 general observer logic that reacts on a given message configuration.

Note
  • This observer observes a message
  • The reaction to the message is the increase of the current number or the needed number

Member Enumeration Documentation

Enumerator
REACTION_NONE 
REACTION_DEC_CURRENT_NUMBER 
REACTION_INC_CURRENT_NUMBER 
REACTION_DEC_NEEDED_NUMBER 
REACTION_INC_NEEDED_NUMBER 

Constructor & Destructor Documentation

em5::MessageObjectiveGeneralObserver::MessageObjectiveGeneralObserver ( )

Default constructor.

Member Function Documentation

void em5::MessageObjectiveGeneralObserver::connectToObjective ( Objective objective,
ObserverReactionType  observerReaction 
)

Connect this observer to an objective to be informed when an infected person was healed.

Parameters
[in]objectiveThe objective instance to connect to
[in]observerReactionBit mask parameter that changes the observer reaction
virtual void em5::MessageObjectiveGeneralObserver::onShutdown ( )
overridevirtual

Shut down the game logic.

Reimplemented from em5::Observer.

virtual bool em5::MessageObjectiveGeneralObserver::onStartup ( )
overridevirtual

Start up the game logic.

Reimplemented from em5::Observer.

void em5::MessageObjectiveGeneralObserver::registerMessage ( const qsf::MessageConfiguration configuration)

Register the message proxy if the target entity is the containing entity.

Parameters
[in]configurationThe message configuration of the observed message
void em5::MessageObjectiveGeneralObserver::registerMessage ( const qsf::MessageConfiguration configuration,
uint32  entityIdFilter 
)

Register the message proxy if the target entities have their ID in the filters.

Parameters
[in]configurationThe message configuration of the observed message
[in]entityIdFilterThe position of the filter where the entity ID is
void em5::MessageObjectiveGeneralObserver::registerMessage ( const qsf::MessageConfiguration configuration,
std::string  entityIdParameter 
)

Register the message proxy if the target entities have their ID in the parameters.

Parameters
[in]configurationThe message configuration of the observed message
[in]entityIdParameterThe name of the parameter where the entity ID is
virtual void em5::MessageObjectiveGeneralObserver::serialize ( qsf::BinarySerializer serializer)
overridevirtual

Serialize or deserialize the game logic using a binary serializer.

Parameters
[in]serializerThe serializer, which can be either in read or write mode

Reimplemented from qsf::GameLogic.

Member Data Documentation

const uint32 em5::MessageObjectiveGeneralObserver::GAMELOGIC_TYPE_ID
static

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