Emergency 20 Dokumentation  4.2.0
em5::FreeplayEvent Class Referenceabstract

Abstract EMERGENCY 5 freeplay event base class. More...

#include <FreeplayEvent.h>

Inheritance diagram for em5::FreeplayEvent:
qsf::Object qsf::WeakPtrTarget em5::ArsonistEvent em5::BoatFireEvent em5::BuildingCollapseEvent em5::BuildingNearlyCollapseEvent em5::BuildingProtectionEvent em5::BuriedPersonEvent em5::CarTheftEvent em5::CityBlackoutEvent em5::ComplexFireEvent em5::DefectEboxEvent em5::DemonstrationEvent em5::DemonstrationMobEvent em5::DrunkenOverboardEvent em5::DummyEvent em5::EvacuateTrainStationEvent em5::FairVisitorsWithFoodPoisoningEvent em5::GangsterEvent em5::GangsterTestEvent em5::GrandTheftAutoEvent em5::HeatWaveEvent em5::HostagesEvent em5::MainEvent em5::ManhuntEvent em5::MedicalEmergencyEvent em5::MedicalInBuildingEvent em5::MissingPersonEvent em5::MultiplayerDummyEvent em5::PillageBuildingEvent em5::PlaneCrashEvent em5::RiotEvent em5::RunningAmokEvent em5::SabotageEvent em5::SimpleFireEvent em5::StormDamageEvent em5::TerrorAttackEvent em5::TrafficAccident01Event em5::TrainAccidentEvent em5::Tutorial em5::VehicleFireEvent em5::WeaponDealEvent

Classes

struct  EventResult
 
struct  ObjectiveResult
 
struct  RecordedHintSystemMessage
 

Public Types

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 }
 

Public Member Functions

 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 bool checkEventConfiguration ()=0
 Returns "true" if the event has the right configuration and can trigger right now. More...
 
virtual bool onStartup ()
 React to startup of the freeplay event. More...
 
virtual void onShutdown ()
 React to shutdown of the freeplay event. More...
 
virtual void onRun ()
 React to state change from (initial) hidden state to running state. More...
 
virtual bool onSuccess (EventResult &eventResult)
 React to state change from running state to success state. More...
 
virtual bool onFailure (EventResult &eventResult)
 React to state change from running state to failed state. More...
 
virtual uint32 calculatePointGain (EventResult &eventResult)
 Calculate the point gain for this event. More...
 
virtual void updateFreeplayEvent (const qsf::Time &timePassed)=0
 Regular update call, gets called once a game tick. 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 hintCallback (Observer &hintObserver)
 Handle the activation of a hint observer. More...
 
virtual void hintCallbackWithMessage (Observer &hintObserver, const qsf::MessageParameters &parameters)
 
virtual void onTimerTriggered (uint32 timerId)
 
virtual const qsf::EntitygetFocusEntity ()
 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 void serialize (qsf::BinarySerializer &serializer)
 Serialization using a binary serializer. More...
 
- 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 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
 

Protected Member Functions

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...
 

Friends

class FreeplayEventManager
 
class EventSpreading
 
class Observer
 
class HintHelper
 
class ObjectiveHelper
 
class ObserverHelper
 
class EventIdComponent
 
class MultiplayerDummyEvent
 

Detailed Description

Abstract EMERGENCY 5 freeplay event base class.

Remarks
Sub-class implementations of this class represent single freeplay event instances. Do not mix up events with event factories:
  • Events are the actively running instances that affect the simulation
  • Event factories are used to check event preconditions and generate event instances

Member Typedef Documentation

typedef boost::container::flat_map<std::string, int> em5::FreeplayEvent::ObjectivePoints

Member Enumeration Documentation

Event flags

Enumerator
WORLD_EVENT 

World event.

MINI_EVENT 

Mini-event for EM2016/2017 campaign.

Event state

Enumerator
STATE_HIDDEN 
STATE_RUNNING 
STATE_SUCCESS 
STATE_FAILED 

Constructor & Destructor Documentation

em5::FreeplayEvent::FreeplayEvent ( )

Default constructor.

em5::FreeplayEvent::~FreeplayEvent ( )
inlinevirtual

Destructor.

Member Function Documentation

void em5::FreeplayEvent::abortEvent ( )

Abort this event.

virtual bool em5::FreeplayEvent::addEntityToEvent ( qsf::Entity targetEntity,
eventspreadreason::Reason  eventSpreadReason,
bool  newReason 
)
virtual

React to adding to an entity to this event, i.e. setting the event ID for the entity.

Parameters
[in]targetEntityThe entity just added; could already have been added before
[in]eventSpreadReasonThe reason why this entity was added
[in]newReason"true" if either the entity was not associated with this event before or if it was added with another event spread reason
Returns
"true" if the entity is added correctly to the event

Reimplemented in em5::SimpleFireEvent, em5::MainEvent104, em5::MedicalInBuildingEvent, em5::MainEvent200, em5::Tutorial, em5::BuildingCollapseEvent, em5::RiotEvent, em5::HeatWaveEvent, em5::MedicalEmergencyEvent, em5::BuriedPersonEvent, em5::BoatFireEvent, em5::MainEvent204, em5::MainEvent100, em5::DummyEvent, em5::TrafficAccident01Event, em5::MainEvent01, em5::MainEvent12, em5::ManhuntEvent, em5::ArsonistEvent, em5::CityBlackoutEvent, em5::MainEvent201, em5::ComplexFireEvent, em5::PillageBuildingEvent, em5::MainEvent203, em5::MainEvent102, em5::MainEvent202, em5::StormDamageEvent, em5::VehicleFireEvent, em5::MainEvent301, em5::MainEvent306, em5::MainEvent308, em5::DrunkenOverboardEvent, em5::MainEvent15, em5::DirtyBombEvent, em5::DemonstrationMobEvent, em5::MainEvent07, em5::MainEvent103, em5::MainEvent04, em5::MainEvent05, em5::DefectEboxEvent, em5::FairBomberEvent, em5::MainEvent307, em5::MainEvent309, em5::MainEvent02, em5::BuildingProtectionEvent, em5::EvacuateTrainStationEvent, em5::WeaponDealEvent, em5::BuildingNearlyCollapseEvent, em5::TrainAccidentEvent, em5::MainEvent14, em5::MainEvent06, em5::HeistEvent, em5::FairVisitorsWithFoodPoisoningEvent, em5::MainEvent101, em5::MainEvent302, em5::MainEvent303, em5::MainEvent304, em5::MainEvent305, em5::MainEvent310, em5::MainEvent08, em5::BomberEvent, em5::RunningAmokEvent, em5::MainEvent10, em5::SabotageEvent, em5::RobberyEvent, em5::PlaneCrashEvent, em5::JailbreakEvent, em5::TerrorAttackEvent, em5::ComplexMedicalEmergencyEvent, and em5::PickpocketEvent.

Objective& em5::FreeplayEvent::addFailCondition ( uint32  objectiveId,
uint32  neededNumber,
const std::string &  objectiveText 
)
protected

Add a new fail condition (which is internally an objective as well)

Objective& em5::FreeplayEvent::addObjective ( uint32  objectiveId,
uint32  orderPriority = 100 
)
protected

Add a new objective, i.e. win condition.

void em5::FreeplayEvent::cancelTimer ( uint32  timerId)
protected
bool em5::FreeplayEvent::checkDebugButton ( const std::string &  buttonName)
protected
void em5::FreeplayEvent::checkObjectivesState ( )
protected

Check the objectives states and finish the event if necessary.

void em5::FreeplayEvent::createEventLocationEntity ( qsf::Entity entity)
protected

Create the event location entity for use with getFocusEntity.

void em5::FreeplayEvent::createEventLocationEntity ( const glm::vec3 &  position)
protected

Create the event location entity for use with getFocusEntity.

template<typename T >
T & em5::FreeplayEvent::createGeneralObserver ( const std::string &  name = std::string())
protected

Create a new general observer (i.e. not bound to a single entity, but observing the whole map) of the specified type.

Observer & em5::FreeplayEvent::createGeneralObserverByTypeId ( uint32  typeId,
const std::string &  name = std::string() 
)
inlineprotected

Create a new general observer (i.e. not bound to a single entity, but observing the whole map) of the specified type ID.

template<typename T >
T & em5::FreeplayEvent::createObserver ( uint64  entityId,
const std::string &  name = std::string() 
)
protected

Create a new observer of the specified type, inside the given entity.

Observer& em5::FreeplayEvent::createObserverByTypeId ( uint32  typeId,
uint64  entityId,
const std::string &  name = std::string() 
)
protected

Create a new observer of the specified type ID, inside the given entity.

bool em5::FreeplayEvent::deserializeEventFromBoostPTree ( const boost::property_tree::ptree pTree,
qsf::Object::SerializationMethod  serializationMethod = qsf::Object::SERIALIZE_IGNORE_UNKNOWN 
)

Deserialize event properties.

void em5::FreeplayEvent::finishObjective ( Objective objective)
bool em5::FreeplayEvent::getCanLoseEvent ( ) const
inline

Access the flag which prevents losing the event even though a fail condition is fulfilled.

bool em5::FreeplayEvent::getCanWinEvent ( ) const
inline

Access the flag which prevents winning the event even though all objectives succeeded.

qsf::Time em5::FreeplayEvent::getCurrentLifeTime ( ) const
inline

Get game time passed since this event was triggered, i.e. got its startup.

qsf::Time em5::FreeplayEvent::getCurrentRunningTime ( ) const
inline

Get game time passed since this event was set to running state, i.e. was showed to the player.

qsf::DynamicMusicCompositorComponent& em5::FreeplayEvent::getDynamicMusicCompositor ( ) const
protected
const FreeplayEvent::EntityIdArray & em5::FreeplayEvent::getEntityIds ( ) const
inline

Get event entities.

float em5::FreeplayEvent::getEventDensity ( ) const
inline

Get the event density.

Returns
Just returns the event density if the event is hidden else returns 0.0f
float em5::FreeplayEvent::getEventDensityIncrease ( ) const
inline

Get event factor.

const qsf::NamedIdentifier & em5::FreeplayEvent::getEventFactoryName ( ) const
inline

Return original freeplay event factory's name.

qsf::Entity* em5::FreeplayEvent::getEventLocationEntity ( ) const
const std::string & em5::FreeplayEvent::getEventName ( ) const
inline

Return freeplay event's localizable name (e.g. "EM5_EVENT_TITLE_04")

uint32 em5::FreeplayEvent::getFailReasonObjectiveTypeId ( const ObjectiveList objectives)
protected

Get the fail condition objectives type ID, of the event that is responsible for the failure of the event.

virtual const qsf::Entity* em5::FreeplayEvent::getFocusEntity ( )
virtual

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 in em5::SimpleFireEvent, em5::MainEvent104, em5::MedicalInBuildingEvent, em5::MainEvent200, em5::Tutorial, em5::BuildingCollapseEvent, em5::HeatWaveEvent, em5::MedicalEmergencyEvent, em5::RiotEvent, em5::BuriedPersonEvent, em5::MainEvent204, em5::BoatFireEvent, em5::MainEvent100, em5::DemonstrationEvent, em5::DummyEvent, em5::MainEvent01, em5::MainEvent12, em5::MainEvent301, em5::MainEvent306, em5::MainEvent308, em5::MainEvent201, em5::TrafficAccident01Event, em5::MainEvent203, em5::MainEvent202, em5::MainEvent102, em5::ManhuntEvent, em5::PillageBuildingEvent, em5::CityBlackoutEvent, em5::ComplexFireEvent, em5::MainEvent15, em5::MainEvent307, em5::MainEvent309, em5::StormDamageEvent, em5::MainEvent302, em5::MainEvent303, em5::MainEvent304, em5::MainEvent305, em5::MissingPersonEvent, em5::VehicleFireEvent, em5::ArsonistEvent, em5::MainEvent07, em5::MainEvent05, em5::MainEvent103, em5::MainEvent04, em5::CarTheftEvent, em5::RowdyEvent, em5::DrunkenOverboardEvent, em5::MainEvent02, em5::MainEvent14, em5::MainEvent101, em5::MainEvent06, em5::MainEvent310, em5::MainEvent08, em5::DemonstrationMobEvent, em5::MainEvent10, em5::BuildingNearlyCollapseEvent, em5::DefectEboxEvent, em5::BuildingProtectionEvent, em5::EvacuateTrainStationEvent, em5::WeaponDealEvent, em5::TrainAccidentEvent, em5::FairVisitorsWithFoodPoisoningEvent, em5::DirtyBombEvent, em5::FairBomberEvent, em5::SabotageEvent, em5::BomberEvent, em5::HeistEvent, em5::MultiplayerDummyEvent, em5::GrandTheftAutoEvent, em5::HostagesEvent, em5::RunningAmokEvent, em5::GangsterTestEvent, em5::RobberyEvent, em5::PlaneCrashEvent, em5::JailbreakEvent, em5::TerrorAttackEvent, and em5::PickpocketEvent.

uint32 em5::FreeplayEvent::getId ( ) const
inline

Return freeplay event ID.

qsf::Map & em5::FreeplayEvent::getMap ( )
inline

Returns the map this event takes place in, all entities of the event are inside this map.

const qsf::Map & em5::FreeplayEvent::getMap ( ) const
inline
uint32 em5::FreeplayEvent::getMultiplayerPointGain ( ) const
inline

Get point gain on multiplayer success.

uint32 em5::FreeplayEvent::getNormalCreditGain ( ) const
inline

Get credit gain on campaign success.

uint32 em5::FreeplayEvent::getNormalPointGain ( ) const
inline

Get point gain on normal success.

const ObjectiveList & em5::FreeplayEvent::getObjectiveList ( ) const
inline

Return the objectives list.

int em5::FreeplayEvent::getObjectivePointByText ( const std::string &  objectiveText) const

Return the points the player get if he close this objective.

int em5::FreeplayEvent::getObjectivePoints ( ) const

Return the points for all objectives.

Remarks
For freeplay events the objectives are deleted after finishing, main event keep them
ObjectiveList & em5::FreeplayEvent::getObjectives ( )
inlineprotected

Return the objectives list.

const ObjectiveList& em5::FreeplayEvent::getObjectivesOrResultObjectives ( ) const
Observer* em5::FreeplayEvent::getObserverByTypeId ( uint32  typeId,
uint64  entityId 
)
protected

Find an existing observer of the specified type ID, inside the given entity.

uint32 em5::FreeplayEvent::getPlayerIndex ( ) const
inline

Returns the player index to which the event is assigned.

qsf::Entity* em5::FreeplayEvent::getRandomEventEntity ( ) const

Get a random event entity.

qsf::Entity* em5::FreeplayEvent::getRandomVisibleEventEntity ( ) const
const FreeplayEvent::RecordedHintSystemMessages & em5::FreeplayEvent::getRecordedHintSystemMessages ( ) const
inline

Return recorded hint system messages.

Returns
Recorded hint system messages
FreeplayEvent::State em5::FreeplayEvent::getState ( ) const
inline

Get or set the music level of the event (high or low)

Get or set event flags

Set event timeout

Get the freeplay event's current state

virtual void em5::FreeplayEvent::hintCallback ( Observer hintObserver)
virtual

Handle the activation of a hint observer.

Reimplemented in em5::SimpleFireEvent, em5::MainEvent104, em5::MedicalInBuildingEvent, em5::MainEvent200, em5::BuildingCollapseEvent, em5::HeatWaveEvent, em5::BoatFireEvent, em5::MedicalEmergencyEvent, em5::RiotEvent, em5::BuriedPersonEvent, em5::DemonstrationEvent, em5::MainEvent204, em5::MainEvent100, em5::DummyEvent, em5::ManhuntEvent, em5::TrafficAccident01Event, em5::CityBlackoutEvent, em5::MainEvent01, em5::MainEvent12, em5::StormDamageEvent, em5::VehicleFireEvent, em5::MainEvent201, em5::ComplexFireEvent, em5::PillageBuildingEvent, em5::MainEvent203, em5::MainEvent102, em5::MainEvent202, em5::MainEvent301, em5::MainEvent306, em5::MainEvent308, em5::MissingPersonEvent, em5::ArsonistEvent, em5::CarTheftEvent, em5::RowdyEvent, em5::MainEvent15, em5::EvacuateTrainStationEvent, em5::WeaponDealEvent, em5::TrainAccidentEvent, em5::MainEvent05, em5::DemonstrationMobEvent, em5::MainEvent07, em5::MainEvent103, em5::MainEvent04, em5::DefectEboxEvent, em5::MainEvent307, em5::MainEvent309, em5::MainEvent02, em5::BuildingProtectionEvent, em5::BuildingNearlyCollapseEvent, em5::MainEvent14, em5::MainEvent06, em5::SabotageEvent, em5::FairVisitorsWithFoodPoisoningEvent, em5::MainEvent101, em5::MainEvent302, em5::MainEvent303, em5::MainEvent304, em5::MainEvent305, em5::MainEvent310, em5::MainEvent08, em5::DirtyBombEvent, em5::MainEvent10, em5::HeistEvent, em5::GrandTheftAutoEvent, em5::HostagesEvent, em5::RunningAmokEvent, em5::GangsterTestEvent, em5::RobberyEvent, em5::PlaneCrashEvent, em5::TerrorAttackEvent, em5::JailbreakEvent, and em5::PickpocketEvent.

virtual void em5::FreeplayEvent::hintCallbackWithMessage ( Observer hintObserver,
const qsf::MessageParameters parameters 
)
virtual
void em5::FreeplayEvent::informFreeplaySystemAboutBeFinished ( )
protected
bool em5::FreeplayEvent::isEventLocationEntitySet ( ) const
inline

Return "true" if the event location entity is set, else "false".

Remarks
An event location entity is used only to mark the event's location for the "jump to event" function (e.g. button in objective window)
bool em5::FreeplayEvent::isMiniEvent ( ) const
inlineprotected
bool em5::FreeplayEvent::isTimeout ( const qsf::Time timePassed)
void em5::FreeplayEvent::markHintAsAlreadyShown ( const std::string &  hintName)
protected
virtual bool em5::FreeplayEvent::onFailure ( EventResult eventResult)
virtual

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 in em5::SimpleFireEvent, em5::MainEvent104, em5::MedicalInBuildingEvent, em5::MainEvent200, em5::HeatWaveEvent, em5::RiotEvent, em5::MedicalEmergencyEvent, em5::BuriedPersonEvent, em5::BoatFireEvent, em5::DemonstrationEvent, em5::DummyEvent, em5::MainEvent204, em5::MainEvent100, em5::ManhuntEvent, em5::MainEvent, em5::CityBlackoutEvent, em5::PillageBuildingEvent, em5::MissingPersonEvent, em5::StormDamageEvent, em5::CarTheftEvent, em5::RowdyEvent, em5::DrunkenOverboardEvent, em5::MainEvent01, em5::MainEvent12, em5::MainEvent201, em5::DemonstrationMobEvent, em5::MainEvent203, em5::MainEvent102, em5::MainEvent202, em5::BuildingProtectionEvent, em5::BuildingNearlyCollapseEvent, em5::FairBomberEvent, em5::MainEvent301, em5::MainEvent306, em5::MainEvent308, em5::EvacuateTrainStationEvent, em5::WeaponDealEvent, em5::TrainAccidentEvent, em5::DirtyBombEvent, em5::FairVisitorsWithFoodPoisoningEvent, em5::BomberEvent, em5::MainEvent15, em5::SabotageEvent, em5::HeistEvent, em5::GrandTheftAutoEvent, em5::HostagesEvent, em5::RunningAmokEvent, em5::MainEvent07, em5::MainEvent103, em5::MainEvent04, em5::MainEvent05, em5::MainEvent307, em5::MainEvent309, em5::MainEvent02, em5::GangsterTestEvent, em5::RobberyEvent, em5::MainEvent14, em5::MainEvent06, em5::MainEvent101, em5::MainEvent302, em5::MainEvent303, em5::MainEvent304, em5::MainEvent305, em5::MainEvent310, em5::MainEvent08, em5::PlaneCrashEvent, em5::MainEvent10, em5::TerrorAttackEvent, em5::JailbreakEvent, em5::OilRefineryExplosionEvent, em5::PickpocketEvent, and em5::Em20MainEventBase.

void em5::FreeplayEvent::onRun ( )
inlinevirtual

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

Note
  • Default implementation is empty

Reimplemented in em5::SimpleFireEvent, em5::MainEvent104, em5::MedicalInBuildingEvent, em5::MainEvent200, em5::BuildingCollapseEvent, em5::HeatWaveEvent, em5::RiotEvent, em5::MedicalEmergencyEvent, em5::BuriedPersonEvent, em5::BoatFireEvent, em5::DemonstrationEvent, em5::Tutorial, em5::DummyEvent, em5::TrafficAccident01Event, em5::MainEvent204, em5::MainEvent100, em5::ManhuntEvent, em5::ComplexFireEvent, em5::CityBlackoutEvent, em5::PillageBuildingEvent, em5::VehicleFireEvent, em5::ArsonistEvent, em5::StormDamageEvent, em5::MissingPersonEvent, em5::CarTheftEvent, em5::RowdyEvent, em5::DrunkenOverboardEvent, em5::MainEvent01, em5::MainEvent12, em5::DemonstrationMobEvent, em5::DefectEboxEvent, em5::MainEvent201, em5::MainEvent203, em5::MainEvent102, em5::MainEvent202, em5::BuildingProtectionEvent, em5::BuildingNearlyCollapseEvent, em5::FairBomberEvent, em5::EvacuateTrainStationEvent, em5::WeaponDealEvent, em5::TrainAccidentEvent, em5::DirtyBombEvent, em5::FairVisitorsWithFoodPoisoningEvent, em5::MainEvent301, em5::MainEvent306, em5::MainEvent308, em5::BomberEvent, em5::MainEvent15, em5::SabotageEvent, em5::HeistEvent, em5::GrandTheftAutoEvent, em5::HostagesEvent, em5::RunningAmokEvent, em5::MainEvent07, em5::MainEvent103, em5::MainEvent04, em5::MainEvent05, em5::GangsterTestEvent, em5::RobberyEvent, em5::MainEvent307, em5::MainEvent309, em5::MainEvent02, em5::MainEvent14, em5::MainEvent06, em5::PlaneCrashEvent, em5::MainEvent101, em5::MainEvent302, em5::MainEvent303, em5::MainEvent304, em5::MainEvent305, em5::MainEvent310, em5::MainEvent08, em5::MainEvent10, em5::TerrorAttackEvent, em5::JailbreakEvent, em5::PickpocketEvent, and em5::Em20MainEventBase.

void em5::FreeplayEvent::onShutdown ( )
inlinevirtual

React to shutdown of the freeplay event.

Note
  • Default implementation is empty

Reimplemented in em5::SimpleFireEvent, em5::MainEvent104, em5::MedicalInBuildingEvent, em5::MainEvent200, em5::BuildingCollapseEvent, em5::HeatWaveEvent, em5::RiotEvent, em5::MedicalEmergencyEvent, em5::BuriedPersonEvent, em5::BoatFireEvent, em5::DemonstrationEvent, em5::Tutorial, em5::DummyEvent, em5::TrafficAccident01Event, em5::MainEvent204, em5::MainEvent100, em5::ManhuntEvent, em5::ComplexFireEvent, em5::MainEvent, em5::CityBlackoutEvent, em5::PillageBuildingEvent, em5::VehicleFireEvent, em5::ArsonistEvent, em5::StormDamageEvent, em5::MissingPersonEvent, em5::CarTheftEvent, em5::RowdyEvent, em5::DrunkenOverboardEvent, em5::MainEvent01, em5::MainEvent12, em5::DemonstrationMobEvent, em5::DefectEboxEvent, em5::MainEvent201, em5::MainEvent203, em5::MainEvent102, em5::MainEvent202, em5::BuildingProtectionEvent, em5::BuildingNearlyCollapseEvent, em5::FairBomberEvent, em5::EvacuateTrainStationEvent, em5::WeaponDealEvent, em5::TrainAccidentEvent, em5::DirtyBombEvent, em5::FairVisitorsWithFoodPoisoningEvent, em5::MainEvent301, em5::MainEvent306, em5::MainEvent308, em5::BomberEvent, em5::MainEvent15, em5::SabotageEvent, em5::HeistEvent, em5::GrandTheftAutoEvent, em5::HostagesEvent, em5::RunningAmokEvent, em5::MainEvent07, em5::MainEvent103, em5::MainEvent04, em5::MainEvent05, em5::GangsterTestEvent, em5::RobberyEvent, em5::MainEvent307, em5::MainEvent309, em5::MainEvent02, em5::MainEvent06, em5::PlaneCrashEvent, em5::MainEvent101, em5::MainEvent302, em5::MainEvent303, em5::MainEvent304, em5::MainEvent305, em5::MainEvent310, em5::MainEvent08, em5::TerrorAttackEvent, em5::JailbreakEvent, em5::OilRefineryExplosionEvent, and em5::PickpocketEvent.

bool em5::FreeplayEvent::onStartup ( )
inlinevirtual

React to startup of the freeplay event.

Note
  • Default implementation simply returns "true"

Reimplemented in em5::SimpleFireEvent, em5::MainEvent104, em5::MedicalInBuildingEvent, em5::MainEvent200, em5::BuildingCollapseEvent, em5::HeatWaveEvent, em5::RiotEvent, em5::MedicalEmergencyEvent, em5::BuriedPersonEvent, em5::BoatFireEvent, em5::DemonstrationEvent, em5::Tutorial, em5::DummyEvent, em5::TrafficAccident01Event, em5::MainEvent204, em5::MainEvent100, em5::ManhuntEvent, em5::ComplexFireEvent, em5::MainEvent, em5::CityBlackoutEvent, em5::PillageBuildingEvent, em5::VehicleFireEvent, em5::ArsonistEvent, em5::StormDamageEvent, em5::MissingPersonEvent, em5::CarTheftEvent, em5::RowdyEvent, em5::DrunkenOverboardEvent, em5::MainEvent01, em5::MainEvent12, em5::DemonstrationMobEvent, em5::DefectEboxEvent, em5::MainEvent201, em5::MainEvent203, em5::MainEvent102, em5::MainEvent202, em5::BuildingProtectionEvent, em5::BuildingNearlyCollapseEvent, em5::FairBomberEvent, em5::EvacuateTrainStationEvent, em5::WeaponDealEvent, em5::TrainAccidentEvent, em5::DirtyBombEvent, em5::FairVisitorsWithFoodPoisoningEvent, em5::MainEvent301, em5::MainEvent306, em5::MainEvent308, em5::BomberEvent, em5::MainEvent15, em5::SabotageEvent, em5::HeistEvent, em5::GrandTheftAutoEvent, em5::HostagesEvent, em5::RunningAmokEvent, em5::MainEvent07, em5::MainEvent103, em5::MainEvent04, em5::MainEvent05, em5::GangsterTestEvent, em5::RobberyEvent, em5::ComplexMedicalEmergencyEvent, em5::MainEvent14, em5::MainEvent307, em5::MainEvent309, em5::MainEvent02, em5::MainEvent06, em5::PlaneCrashEvent, em5::MainEvent101, em5::MainEvent302, em5::MainEvent303, em5::MainEvent304, em5::MainEvent305, em5::MainEvent310, em5::MainEvent08, em5::MainEvent10, em5::TerrorAttackEvent, em5::JailbreakEvent, em5::OilRefineryExplosionEvent, em5::PickpocketEvent, and em5::Em20MainEventBase.

virtual void em5::FreeplayEvent::onTimerTriggered ( uint32  timerId)
inlinevirtual
void em5::FreeplayEvent::pauseEventTime ( )

Pause progress of event time.

void em5::FreeplayEvent::performUpdateFreeplayEvent ( const qsf::Time timePassed)

Perform regular update once a game tick.

void em5::FreeplayEvent::removeObserver ( Observer observer)
protected

Removes and destroys the given observer.

void em5::FreeplayEvent::resumeEventTime ( )

Resume event time after it has been paused.

virtual void em5::FreeplayEvent::serialize ( qsf::BinarySerializer serializer)
virtual

Serialization using a binary serializer.

Reimplemented in em5::SimpleFireEvent, em5::MainEvent104, em5::MainEvent200, em5::MedicalInBuildingEvent, em5::Tutorial, em5::BuildingCollapseEvent, em5::HeatWaveEvent, em5::MainEvent204, em5::MedicalEmergencyEvent, em5::MainEvent100, em5::RiotEvent, em5::BuriedPersonEvent, em5::BoatFireEvent, em5::DemonstrationEvent, em5::MainEvent01, em5::DummyEvent, em5::MainEvent301, em5::MainEvent306, em5::MainEvent308, em5::MainEvent201, em5::MainEvent203, em5::MainEvent202, em5::MainEvent102, em5::TrafficAccident01Event, em5::MainEvent15, em5::MainEvent307, em5::MainEvent309, em5::ManhuntEvent, em5::MainEvent302, em5::MainEvent303, em5::MainEvent304, em5::MainEvent305, em5::CityBlackoutEvent, em5::ComplexFireEvent, em5::PillageBuildingEvent, em5::MainEvent07, em5::MainEvent05, em5::MainEvent, em5::MainEvent103, em5::MainEvent04, em5::StormDamageEvent, em5::MainEvent02, em5::MissingPersonEvent, em5::VehicleFireEvent, em5::ArsonistEvent, em5::MainEvent101, em5::MainEvent06, em5::MainEvent310, em5::CarTheftEvent, em5::RowdyEvent, em5::DrunkenOverboardEvent, em5::DemonstrationMobEvent, em5::DefectEboxEvent, em5::BuildingProtectionEvent, em5::BuildingNearlyCollapseEvent, em5::EvacuateTrainStationEvent, em5::WeaponDealEvent, em5::TrainAccidentEvent, em5::FairBomberEvent, em5::FairVisitorsWithFoodPoisoningEvent, em5::DirtyBombEvent, em5::BomberEvent, em5::SabotageEvent, em5::HeistEvent, em5::GrandTheftAutoEvent, em5::HostagesEvent, em5::RunningAmokEvent, em5::ComplexMedicalEmergencyEvent, em5::GangsterTestEvent, em5::RobberyEvent, em5::PlaneCrashEvent, em5::JailbreakEvent, em5::TerrorAttackEvent, and em5::PickpocketEvent.

void em5::FreeplayEvent::setCanLoseEvent ( bool  canLoseEvent)
inline

Set the flag which prevents losing the event even though a fail condition is fulfilled.

See also
"setCanWinEvent"
void em5::FreeplayEvent::setCanWinEvent ( bool  canWinEvent)
inline

Set the flag which prevents winning the event even though all objectives succeeded.

Remarks
Make use of this flag if the event has points where all objectives can succeed but the event is not actually over yet. E.g. you can have all objectives finished, wait some time and then add new objectives to the player which then need to be achieved, too. Just DO NOT FORGET to set the flag back or the event will never be won!
void em5::FreeplayEvent::setEventDensity ( float  density)
inline

Set event density.

void em5::FreeplayEvent::setEventDensityIncrease ( float  eventDensityIncrease)
inline

Set event factor.

void em5::FreeplayEvent::setEventFactoryName ( const qsf::NamedIdentifier factoryName)
inline

Set original freeplay event factory's name.

void em5::FreeplayEvent::setEventName ( const std::string &  name)
inline

Set freeplay event's localizable name (e.g. "EM5_EVENT_TITLE_04")

void em5::FreeplayEvent::setFailHintsForMiniEvent ( EventResult eventResult,
const std::string &  failedText,
const std::string &  miniEventSupervisorMessage,
const std::string &  standardEventHint = "" 
)
protected
void em5::FreeplayEvent::setFinished ( bool  successful)

Finish the event, and set it either to succeeded or failed.

void em5::FreeplayEvent::setGreatJob ( bool  greatJob)
inline

Set whether or not the normal or great point gain should occur.

void em5::FreeplayEvent::setMultiplayerPointGain ( uint32  pointGain)
inline

Set point gain on multiplayer success.

void em5::FreeplayEvent::setNormalCreditGain ( uint32  creditGain)
inline

Set credit gain on campaign success.

void em5::FreeplayEvent::setNormalPointGain ( uint32  pointGain)
inline

Set point gain on normal success.

void em5::FreeplayEvent::setPlayerIndex ( uint32  playerIndex)

Sets the player index to which the event is assigned.

void em5::FreeplayEvent::setRunning ( )

Set event state to "running", i.e. show the event to the user now.

void em5::FreeplayEvent::setTimer ( uint32  timerId,
qsf::Time  waitTime 
)
protected
void em5::FreeplayEvent::showHint ( const std::string &  hintName,
bool  notMoreThanOnce,
bool  textOnly = false 
)
protected
void em5::FreeplayEvent::showSupervisorMessage ( const std::string &  messageId,
bool  audioOnly = false 
)
protected
void em5::FreeplayEvent::shutdown ( )

Shutdown the freeplay event.

void em5::FreeplayEvent::startTimer ( uint32  timerId,
qsf::Time  waitTime 
)
protected
bool em5::FreeplayEvent::startup ( )

Startup the freeplay event.

void em5::FreeplayEvent::triggerTimer ( uint32  timerId)
protected
bool em5::FreeplayEvent::wasHintShown ( const std::string &  hintName) const
protected

Friends And Related Function Documentation

friend class EventIdComponent
friend
friend class EventSpreading
friend
friend class FreeplayEventManager
friend
friend class HintHelper
friend
friend class MultiplayerDummyEvent
friend
friend class ObjectiveHelper
friend
friend class Observer
friend
friend class ObserverHelper
friend

Member Data Documentation

const uint32 em5::FreeplayEvent::GAME_TIMER_MESSAGE_ID
static

"em5::FreeplayEvent_GameTimerMessage" unique message ID

const std::string em5::FreeplayEvent::MUSIC_LEVEL_HIGH
static
const std::string em5::FreeplayEvent::MUSIC_LEVEL_LOW
static

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