Emergency 20 Dokumentation  4.2.0
em5::HintMessageGeneralObserver Class Reference

EMERGENCY 5 logic hint observer for messages. More...

#include <HintMessageGeneralObserver.h>

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

Public Types

typedef boost::function< bool(const qsf::MessageParameters &, bool)> CustomFilterCallback
 

Public Member Functions

 HintMessageGeneralObserver ()
 Default constructor. More...
 
void initialize ()
 This constructor should be used for case 0. More...
 
void initialize (const qsf::MessageConfiguration &messageConfiguration)
 This constructor should be used for case 1. More...
 
void initialize (const qsf::MessageConfiguration &messageConfiguration, const qsf::Time &timeFrame, const bool messageCreated)
 This constructor should be used for case 2 and 3. More...
 
void initialize (const qsf::MessageConfiguration &delayMessageConfiguration, const qsf::MessageConfiguration &messageConfiguration, const qsf::Time &timeFrame, const bool messageCreated)
 This constructor should be used for case 4. More...
 
void setCustomMessageFilter (const CustomFilterCallback &customFilterCallback)
 Sets a custom message filter callback, which gets called when a message arrives to allow additional filtering if that message should be counted as the to be observed message. 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 logic hint observer for messages.

Note
  • 5 cases are passible to check for:
  • case 0: Just callback now
  • case 1: Just observe a message and callback when a message is created
  • case 2: After a timeframe check if a message was created and callback
  • case 3: After a timeframe check if a message was not created and callback
  • case 4: Adds a message that adds a delay to the timer

After the callback is called the observer is removed

Member Typedef Documentation

Constructor & Destructor Documentation

em5::HintMessageGeneralObserver::HintMessageGeneralObserver ( )

Default constructor.

Member Function Documentation

void em5::HintMessageGeneralObserver::initialize ( )

This constructor should be used for case 0.

void em5::HintMessageGeneralObserver::initialize ( const qsf::MessageConfiguration messageConfiguration)

This constructor should be used for case 1.

Parameters
[in]messageIdId of the message we want to observe
void em5::HintMessageGeneralObserver::initialize ( const qsf::MessageConfiguration messageConfiguration,
const qsf::Time timeFrame,
const bool  messageCreated 
)

This constructor should be used for case 2 and 3.

Parameters
[in]messageConfigurationConfiguration of the message we want to observe in a timeframe
[in]timeFrameSet the timeframe after which it is checked if a message was created or not
[in]messageCreatedSet if this observer should react if a message was created or not (true for case 2 and false for case 3)
void em5::HintMessageGeneralObserver::initialize ( const qsf::MessageConfiguration delayMessageConfiguration,
const qsf::MessageConfiguration messageConfiguration,
const qsf::Time timeFrame,
const bool  messageCreated 
)

This constructor should be used for case 4.

Parameters
[in]delayMessageConfigurationAdds a message that delays the observer
[in]messageConfigurationConfiguration of the message we want to observe in a timeframe
[in]timeFrameSet the timeframe after which it is checked if a message was created or not
[in]messageCreatedSet if this observer should react if a message was created or not (true for case 2 and false for case 3)
virtual void em5::HintMessageGeneralObserver::onShutdown ( )
overridevirtual

Shut down the game logic.

Reimplemented from em5::Observer.

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

Start up the game logic.

Reimplemented from em5::Observer.

virtual void em5::HintMessageGeneralObserver::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.

void em5::HintMessageGeneralObserver::setCustomMessageFilter ( const CustomFilterCallback customFilterCallback)

Sets a custom message filter callback, which gets called when a message arrives to allow additional filtering if that message should be counted as the to be observed message.

Parameters
[in]customFilterCallbackThe callback for the custom filtering

Member Data Documentation

const uint32 em5::HintMessageGeneralObserver::GAMELOGIC_TYPE_ID
static

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