Emergency 20 Dokumentation  4.2.0
em5::MedicalEmergencyEventFactory Class Reference

EMERGENCY 5 freeplay event factory for "medical emergency". More...

#include <MedicalEmergencyEventFactory.h>

Inheritance diagram for em5::MedicalEmergencyEventFactory:
em5::FreeplayEventFactory qsf::Object em5::ComplexMedicalEmergencyEventFactory

Public Types

typedef qsf::EnumBitmask< uint8, PersonComponent::AgeAgeBitmask
- Public Types inherited from em5::FreeplayEventFactory
typedef std::vector< boost::property_tree::ptreeVariantArray
- Public Types inherited from qsf::Object
enum  SerializationMode { MODE_MINIMAL, MODE_COMPATIBLE }

Public Member Functions

 MedicalEmergencyEventFactory ()
 Default constructor. More...
virtual ~MedicalEmergencyEventFactory ()
 Destructor. More...
std::string getAgeAsString () const
 Get age as string. More...
void setAgeAsString (const std::string &jsonAge)
 Set age bitmask. More...
AgeBitmask getAge () const
 Return age bitmask. More...
void setAge (AgeBitmask age)
 Set age bitmask. More...
std::string getWeatherAsString () const
 Get weather. More...
void setWeatherAsString (const std::string &weather)
 Set weather bitmask. More...
WeatherComponent::WeatherBitmask getWeather () const
 Return weather bitmask. More...
void setWeather (WeatherComponent::WeatherBitmask weather)
 Set weather bitmask. More...
bool getInsideBuilding () const
 Get inside building. More...
void setInsideBuilding (bool insideBuilding)
 Set inside building. More...
const std::string & getEventLayer () const
 Get event layer. More...
void setEventLayer (const std::string &eventLayer)
 Set event layer. More...
virtual FreeplayEventtryTriggerEvent () override
- Public Member Functions inherited from em5::FreeplayEventFactory
 FreeplayEventFactory ()
 Constructor. More...
virtual ~FreeplayEventFactory ()
 Destructor. More...
uint32 getId () const
 Return event factory's unique ID. More...
const std::string & getEventName () const
 Return event's name. More...
bool isEnabled () const
 Return whether or not the factory is currently enabled for the game. More...
float getTriggerChance () const
 Return trigger chance for this event factory. More...
void setTriggerChance (float triggerChance)
 Set trigger chance for this event factory. More...
float getEventDensity () const
 Get event density. More...
void setEventDensity (float eventDensity)
 Set event desity. More...
bool getStartEvent () const
 Get start event. More...
void setStartEvent (bool startEvent)
uint32 getMaxAppearances () const
 Get limit of appearances. More...
void setMaxAppearances (uint32 maxAppearances)
const std::string & getEventTag () const
 Get the event tag (used to search the target entity) More...
void setEventTag (const std::string &eventTag)
 Set the event tag (used to search the target entity) More...
const VariantArraygetVariants () const
 Get the variants of the freeplay event factory. More...
void setVariants (const VariantArray &variants)
 Set the variants of the freeplay event factory. More...
const boost::property_tree::ptreegetRandomVariant () const
 Get a random variant of the variant array. More...
const boost::property_tree::ptreegetMainVariant () const
 Get a main variant of the variant array. More...
const boost::property_tree::ptreegetVariantByIndex (uint32 index) const
 Get a variant of the variant array by index. More...
bool operator== (const FreeplayEventFactory &other) const
 Compare this factory's unique ID to an other factory's unique ID. More...
bool operator== (const std::string &other) const
 Compare this factory's name to an std::string. More...
bool operator== (uint32 other) const
 Compare this factory's unique ID to a uint32. More...
FreeplayEventtryTriggerEvent (const FreeplayEventTriggerInfo &triggerInfo)
 Check if the event preconditions are met and if so, generate an event instance. 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 Member Functions

static qsf::EntitygetRandomCandidatePerson (const AgeBitmask *ageBitmask=nullptr, bool insideBuilding=false)

Protected Member Functions

bool checkWeatherConditions () const
qsf::EntityfindCandidate () const
- Protected Member Functions inherited from em5::FreeplayEventFactory
template<typename T >
T & createAndInitializeEvent ()
FreeplayEventcreateAndInitializeEventByClassName (const std::string &className)
void deserializeRandomFreeplayVariant (FreeplayEvent &freeplayEvent)
void deserializeFreeplayVariantByIndex (FreeplayEvent &freeplayEvent, uint32 index)
bool isEventAlreadyRunning () const
const FreeplayEventTriggerInfogetTriggerInfo () const
void setTriggerFailReason (const std::string &reason) const
qsf::LayergetCandidateEventLayer (const std::string &eventLayerName, const std::string &baseLayerName, const boost::function< bool(const qsf::Layer &)> &checkCandidateCallback) const
 Try to get a randomly chosen layer to use for a event. More...
- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. More...

Additional Inherited Members

- Protected Attributes inherited from em5::FreeplayEventFactory
std::string mEventTag

Detailed Description

EMERGENCY 5 freeplay event factory for "medical emergency".

Member Typedef Documentation

Constructor & Destructor Documentation

em5::MedicalEmergencyEventFactory::MedicalEmergencyEventFactory ( )

Default constructor.

virtual em5::MedicalEmergencyEventFactory::~MedicalEmergencyEventFactory ( )


Member Function Documentation

bool em5::MedicalEmergencyEventFactory::checkWeatherConditions ( ) const
qsf::Entity* em5::MedicalEmergencyEventFactory::findCandidate ( ) const
MedicalEmergencyEventFactory::AgeBitmask em5::MedicalEmergencyEventFactory::getAge ( ) const

Return age bitmask.

std::string em5::MedicalEmergencyEventFactory::getAgeAsString ( ) const

Get age as string.

Age as string
const std::string & em5::MedicalEmergencyEventFactory::getEventLayer ( ) const

Get event layer.

bool em5::MedicalEmergencyEventFactory::getInsideBuilding ( ) const

Get inside building.

static qsf::Entity* em5::MedicalEmergencyEventFactory::getRandomCandidatePerson ( const AgeBitmask ageBitmask = nullptr,
bool  insideBuilding = false 
WeatherComponent::WeatherBitmask em5::MedicalEmergencyEventFactory::getWeather ( ) const

Return weather bitmask.

std::string em5::MedicalEmergencyEventFactory::getWeatherAsString ( ) const

Get weather.

Get weather as string
void em5::MedicalEmergencyEventFactory::setAge ( MedicalEmergencyEventFactory::AgeBitmask  age)

Set age bitmask.

void em5::MedicalEmergencyEventFactory::setAgeAsString ( const std::string &  jsonAge)

Set age bitmask.

[in]jsonAgeAge enum bitmask as string
void em5::MedicalEmergencyEventFactory::setEventLayer ( const std::string &  eventLayer)

Set event layer.

void em5::MedicalEmergencyEventFactory::setInsideBuilding ( bool  insideBuilding)

Set inside building.

void em5::MedicalEmergencyEventFactory::setWeather ( WeatherComponent::WeatherBitmask  weather)

Set weather bitmask.

void em5::MedicalEmergencyEventFactory::setWeatherAsString ( const std::string &  weather)

Set weather bitmask.

[in]weatherWeather enum bitmask as string
virtual FreeplayEvent* em5::MedicalEmergencyEventFactory::tryTriggerEvent ( )

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