Emergency 20 Dokumentation  4.2.0
em5::MissingPersonEvent Class Reference

EMERGENCY 5 freeplay event "missing person". More...

#include <MissingPersonEvent.h>

Inheritance diagram for em5::MissingPersonEvent:
em5::FreeplayEvent qsf::Object qsf::WeakPtrTarget

Public Member Functions

 MissingPersonEvent ()
 Default constructor. More...
 
virtual ~MissingPersonEvent ()
 Destructor. More...
 
void init (qsf::Entity &entity, uint64 DogSearchSpotId)
 Initialize the event with values. More...
 
const std::string & getInjuryName () const
 Get name of the injury the missing person receives. More...
 
void setInjuryName (const std::string &injuryName)
 Set name of the injury the missing person receives. More...
 
virtual bool onStartup () override
 React to startup of the freeplay event. More...
 
virtual void onShutdown () override
 React to shutdown of the freeplay event. More...
 
virtual void onRun () override
 React to state change from (initial) hidden state to running state. More...
 
virtual bool onSuccess (EventResult &eventResult) override
 React to state change from running state to success state. More...
 
virtual bool onFailure (EventResult &eventResult) override
 React to state change from running state to failed state. More...
 
virtual void updateFreeplayEvent (const qsf::Time &timePassed) override
 Regular update call, gets called once a game tick. More...
 
virtual void hintCallback (Observer &hintObserver) override
 Handle the activation of a hint observer. More...
 
virtual const qsf::EntitygetFocusEntity () override
 Get an event entity that is currently crucial for this event This is the entity which gets the focus when the player clicks on go to event. More...
 
virtual bool checkEventConfiguration () override
 Returns "true" if the event has the right configuration and can trigger right now. More...
 
virtual void serialize (qsf::BinarySerializer &serializer) override
 Serialization using a binary serializer. More...
 
- Public Member Functions inherited from em5::FreeplayEvent
 FreeplayEvent ()
 Default constructor. More...
 
virtual ~FreeplayEvent ()
 Destructor. More...
 
uint32 getId () const
 Return freeplay event ID. More...
 
const std::string & getEventName () const
 Return freeplay event's localizable name (e.g. "EM5_EVENT_TITLE_04") More...
 
void setEventName (const std::string &name)
 Set freeplay event's localizable name (e.g. "EM5_EVENT_TITLE_04") More...
 
const qsf::NamedIdentifiergetEventFactoryName () const
 Return original freeplay event factory's name. More...
 
void setEventFactoryName (const qsf::NamedIdentifier &factoryName)
 Set original freeplay event factory's name. More...
 
const EntityIdArraygetEntityIds () const
 Get event entities. More...
 
qsf::EntitygetRandomEventEntity () const
 Get a random event entity. More...
 
qsf::EntitygetRandomVisibleEventEntity () const
 
const ObjectiveListgetObjectiveList () const
 Return the objectives list. More...
 
const ObjectiveListgetObjectivesOrResultObjectives () const
 
qsf::MapgetMap ()
 Returns the map this event takes place in, all entities of the event are inside this map. More...
 
const qsf::MapgetMap () const
 
int getObjectivePointByText (const std::string &objectiveText) const
 Return the points the player get if he close this objective. More...
 
int getObjectivePoints () const
 Return the points for all objectives. More...
 
const RecordedHintSystemMessagesgetRecordedHintSystemMessages () const
 Return recorded hint system messages. More...
 
bool startup ()
 Startup the freeplay event. More...
 
void shutdown ()
 Shutdown the freeplay event. More...
 
void setRunning ()
 Set event state to "running", i.e. show the event to the user now. More...
 
void setFinished (bool successful)
 Finish the event, and set it either to succeeded or failed. More...
 
void abortEvent ()
 Abort this event. More...
 
void setCanWinEvent (bool canWinEvent)
 Set the flag which prevents winning the event even though all objectives succeeded. More...
 
bool getCanWinEvent () const
 Access the flag which prevents winning the event even though all objectives succeeded. More...
 
void setCanLoseEvent (bool canLoseEvent)
 Set the flag which prevents losing the event even though a fail condition is fulfilled. More...
 
bool getCanLoseEvent () const
 Access the flag which prevents losing the event even though a fail condition is fulfilled. More...
 
void finishObjective (Objective &objective)
 
void performUpdateFreeplayEvent (const qsf::Time &timePassed)
 Perform regular update once a game tick. More...
 
void pauseEventTime ()
 Pause progress of event time. More...
 
void resumeEventTime ()
 Resume event time after it has been paused. More...
 
qsf::Time getCurrentLifeTime () const
 Get game time passed since this event was triggered, i.e. got its startup. More...
 
qsf::Time getCurrentRunningTime () const
 Get game time passed since this event was set to running state, i.e. was showed to the player. More...
 
void setGreatJob (bool greatJob)
 Set whether or not the normal or great point gain should occur. More...
 
uint32 getNormalPointGain () const
 Get point gain on normal success. More...
 
void setNormalPointGain (uint32 pointGain)
 Set point gain on normal success. More...
 
uint32 getNormalCreditGain () const
 Get credit gain on campaign success. More...
 
void setNormalCreditGain (uint32 creditGain)
 Set credit gain on campaign success. More...
 
uint32 getMultiplayerPointGain () const
 Get point gain on multiplayer success. More...
 
void setMultiplayerPointGain (uint32 pointGain)
 Set point gain on multiplayer success. More...
 
State getState () const
 Get or set the music level of the event (high or low) More...
 
float getEventDensityIncrease () const
 Get event factor. More...
 
void setEventDensityIncrease (float eventDensityIncrease)
 Set event factor. More...
 
float getEventDensity () const
 Get the event density. More...
 
void setEventDensity (float density)
 Set event density. More...
 
bool deserializeEventFromBoostPTree (const boost::property_tree::ptree &pTree, qsf::Object::SerializationMethod serializationMethod=qsf::Object::SERIALIZE_IGNORE_UNKNOWN)
 Deserialize event properties. More...
 
uint32 getPlayerIndex () const
 Returns the player index to which the event is assigned. More...
 
void setPlayerIndex (uint32 playerIndex)
 Sets the player index to which the event is assigned. More...
 
bool isEventLocationEntitySet () const
 Return "true" if the event location entity is set, else "false". More...
 
qsf::EntitygetEventLocationEntity () const
 
bool isTimeout (const qsf::Time &timePassed)
 
virtual uint32 calculatePointGain (EventResult &eventResult)
 Calculate the point gain for this event. More...
 
virtual bool addEntityToEvent (qsf::Entity &targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason)
 React to adding to an entity to this event, i.e. setting the event ID for the entity. More...
 
virtual void hintCallbackWithMessage (Observer &hintObserver, const qsf::MessageParameters &parameters)
 
virtual void onTimerTriggered (uint32 timerId)
 
- Public Member Functions inherited from qsf::Object
virtual ~Object ()
 Destructor. More...
 
const camp::Class & getCampClass () const
 Return the CAMP class. More...
 
int getPropertyIndexById (const StringHash &propertyId) const
 Return the CAMP property index by using the unique class property ID. More...
 
uint32 getPropertyIdByIndex (int index) const
 Return the unique class property ID with the given index. More...
 
std::string getPropertyNameById (const StringHash &propertyId) const
 Return the CAMP property name by using the unique class property ID. More...
 
const camp::Property * getCampPropertyById (const StringHash &propertyId) const
 Return the CAMP property by using the unique class property ID. More...
 
void setPropertyValuesByString (const std::string &values)
 Set CAMP reflection property values by using a given string. More...
 
void setPropertiesToDefaultValues ()
 Set all CAMP reflection system properties to their default values. More...
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
void serializeToBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void deserializeFromBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL, bool setOverrideState=true)
 
virtual camp::Value getPropertyDefaultValue (const StringHash &propertyId) const
 
virtual PropertyOverrideState getPropertyOverrideState (const StringHash &propertyId) const
 
virtual bool setPropertyOverrideState (const StringHash &propertyId, PropertyOverrideState overrideState)
 
virtual void onPreDeserialize ()
 Called right before the object is deserialized using any of the above methods. Default implementation is empty. More...
 
virtual void onPostDeserialize ()
 Called right after the object was deserialized using any of the above methods. Default implementation is empty. More...
 
virtual ScriptgetAssociatedScript () const
 Return the script instance associated with this object instance. More...
 

Static Public Attributes

static const uint32 FREEPLAY_EVENT_ID
 "em5::MissingPersonEvent" unique freeplay event ID More...
 
- Static Public Attributes inherited from em5::FreeplayEvent
static const uint32 GAME_TIMER_MESSAGE_ID
 "em5::FreeplayEvent_GameTimerMessage" unique message ID More...
 
static const std::string MUSIC_LEVEL_LOW
 
static const std::string MUSIC_LEVEL_HIGH
 

Additional Inherited Members

- Public Types inherited from em5::FreeplayEvent
enum  State { STATE_HIDDEN = 0, STATE_RUNNING, STATE_SUCCESS, STATE_FAILED }
 
enum  EventFlag { EventFlag::WORLD_EVENT, EventFlag::MINI_EVENT }
 
typedef qsf::EnumBitmask< uint8, EventFlagEventFlagSet
 
typedef ObjectiveList::ObjectiveInstanceMap ObjectiveInstanceMap
 
typedef std::vector< uint64EntityIdArray
 
typedef boost::container::flat_map< std::string, int > ObjectivePoints
 
typedef std::vector< RecordedHintSystemMessageRecordedHintSystemMessages
 
- Public Types inherited from qsf::Object
enum  PropertyOverrideState { PROPERTY_INVALID, PROPERTY_DEFAULT, PROPERTY_OVERRIDE, PROPERTY_REMOVED }
 
enum  SerializationMethod { SERIALIZE_FLAT, SERIALIZE_COMPLETE, SERIALIZE_DIFFERENTIAL, SERIALIZE_IGNORE_UNKNOWN }
 
enum  SerializationMode { MODE_MINIMAL, MODE_COMPATIBLE }
 
- Protected Member Functions inherited from em5::FreeplayEvent
ObjectiveaddObjective (uint32 objectiveId, uint32 orderPriority=100)
 Add a new objective, i.e. win condition. More...
 
ObjectiveaddFailCondition (uint32 objectiveId, uint32 neededNumber, const std::string &objectiveText)
 Add a new fail condition (which is internally an objective as well) More...
 
ObjectiveListgetObjectives ()
 Return the objectives list. More...
 
void checkObjectivesState ()
 Check the objectives states and finish the event if necessary. More...
 
uint32 getFailReasonObjectiveTypeId (const ObjectiveList &objectives)
 Get the fail condition objectives type ID, of the event that is responsible for the failure of the event. More...
 
bool wasHintShown (const std::string &hintName) const
 
void showHint (const std::string &hintName, bool notMoreThanOnce, bool textOnly=false)
 
void showSupervisorMessage (const std::string &messageId, bool audioOnly=false)
 
void markHintAsAlreadyShown (const std::string &hintName)
 
ObservercreateObserverByTypeId (uint32 typeId, uint64 entityId, const std::string &name=std::string())
 Create a new observer of the specified type ID, inside the given entity. More...
 
template<typename T >
T & createObserver (uint64 entityId, const std::string &name=std::string())
 Create a new observer of the specified type, inside the given entity. More...
 
ObservercreateGeneralObserverByTypeId (uint32 typeId, const std::string &name=std::string())
 Create a new general observer (i.e. not bound to a single entity, but observing the whole map) of the specified type ID. More...
 
template<typename T >
T & createGeneralObserver (const std::string &name=std::string())
 Create a new general observer (i.e. not bound to a single entity, but observing the whole map) of the specified type. More...
 
ObservergetObserverByTypeId (uint32 typeId, uint64 entityId)
 Find an existing observer of the specified type ID, inside the given entity. More...
 
void removeObserver (Observer &observer)
 Removes and destroys the given observer. More...
 
void informFreeplaySystemAboutBeFinished ()
 
void createEventLocationEntity (qsf::Entity &entity)
 Create the event location entity for use with getFocusEntity. More...
 
void createEventLocationEntity (const glm::vec3 &position)
 Create the event location entity for use with getFocusEntity. More...
 
qsf::DynamicMusicCompositorComponentgetDynamicMusicCompositor () const
 
bool isMiniEvent () const
 
void setFailHintsForMiniEvent (EventResult &eventResult, const std::string &failedText, const std::string &miniEventSupervisorMessage, const std::string &standardEventHint="")
 
void startTimer (uint32 timerId, qsf::Time waitTime)
 
void setTimer (uint32 timerId, qsf::Time waitTime)
 
void cancelTimer (uint32 timerId)
 
void triggerTimer (uint32 timerId)
 
bool checkDebugButton (const std::string &buttonName)
 
- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. 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 freeplay event "missing person".

Constructor & Destructor Documentation

em5::MissingPersonEvent::MissingPersonEvent ( )

Default constructor.

virtual em5::MissingPersonEvent::~MissingPersonEvent ( )
virtual

Destructor.

Member Function Documentation

virtual bool em5::MissingPersonEvent::checkEventConfiguration ( )
overridevirtual

Returns "true" if the event has the right configuration and can trigger right now.

Implements em5::FreeplayEvent.

virtual const qsf::Entity* em5::MissingPersonEvent::getFocusEntity ( )
overridevirtual

Get an event entity that is currently crucial for this event This is the entity which gets the focus when the player clicks on go to event.

Reimplemented from em5::FreeplayEvent.

const std::string& em5::MissingPersonEvent::getInjuryName ( ) const

Get name of the injury the missing person receives.

virtual void em5::MissingPersonEvent::hintCallback ( Observer hintObserver)
overridevirtual

Handle the activation of a hint observer.

Reimplemented from em5::FreeplayEvent.

void em5::MissingPersonEvent::init ( qsf::Entity entity,
uint64  DogSearchSpotId 
)

Initialize the event with values.

virtual bool em5::MissingPersonEvent::onFailure ( EventResult eventResult)
overridevirtual

React to state change from running state to failed state.

Returns
"true" when the freeplay system should be informed immediately, otherwise false (When false then the freeplay event is responsible to call informFreeplaySystemAboutBeFinished)

Reimplemented from em5::FreeplayEvent.

virtual void em5::MissingPersonEvent::onRun ( )
overridevirtual

React to state change from (initial) hidden state to running state.

Note
  • Default implementation is empty

Reimplemented from em5::FreeplayEvent.

virtual void em5::MissingPersonEvent::onShutdown ( )
overridevirtual

React to shutdown of the freeplay event.

Note
  • Default implementation is empty

Reimplemented from em5::FreeplayEvent.

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

React to startup of the freeplay event.

Note
  • Default implementation simply returns "true"

Reimplemented from em5::FreeplayEvent.

virtual bool em5::MissingPersonEvent::onSuccess ( EventResult eventResult)
overridevirtual

React to state change from running state to success state.

Returns
"true" when the freeplay system should be informed immediately, otherwise false (When false then the freeplay event is responsible to call informFreeplaySystemAboutBeFinished)
Note
  • Default implementation is empty

Reimplemented from em5::FreeplayEvent.

virtual void em5::MissingPersonEvent::serialize ( qsf::BinarySerializer serializer)
overridevirtual

Serialization using a binary serializer.

Reimplemented from em5::FreeplayEvent.

void em5::MissingPersonEvent::setInjuryName ( const std::string &  injuryName)

Set name of the injury the missing person receives.

virtual void em5::MissingPersonEvent::updateFreeplayEvent ( const qsf::Time timePassed)
overridevirtual

Regular update call, gets called once a game tick.

Implements em5::FreeplayEvent.

Member Data Documentation

const uint32 em5::MissingPersonEvent::FREEPLAY_EVENT_ID
static

"em5::MissingPersonEvent" unique freeplay event ID


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