Emergency 20 Dokumentation  4.2.0
em5::OrderInfo Class Reference

Order information. More...

#include <OrderInfo.h>

Inheritance diagram for em5::OrderInfo:
qsf::Object

Public Types

typedef std::pair< std::string, uint32OrderPair
 
typedef boost::container::flat_map< std::string, uint32OrderPairList
 
- 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

 OrderInfo (uint32 key)
 Constructor. More...
 
virtual ~OrderInfo ()
 Destructor. More...
 
uint32 getOrderInfoId () const
 Get unique order information ID, which is the hashed name. More...
 
const std::string & getName () const
 Get name of the order information, e.g. "RW". More...
 
void setName (const std::string &name)
 Set name of the order information. More...
 
const qsf::AssetProxygetPrefab () const
 Return the prefab asset to use. More...
 
void setPrefab (const qsf::AssetProxy &prefab)
 Set the prefab asset to use. More...
 
const std::string & getLocalizedName () const
 Get the localized name ID. More...
 
void setLocalizedName (const std::string &name)
 Set the localized name ID. More...
 
units::Department getDepartment () const
 Get the department. More...
 
const std::string & getDepartmentAsString () const
 Get the department name. More...
 
void setDepartment (units::Department department)
 Set the department. More...
 
void setDepartmentAsString (const std::string &department)
 Set the department by name. More...
 
std::string getUnitTagsAsString () const
 Get unit tags as a single string. More...
 
void setUnitTagsAsString (const std::string &unitTags)
 Set unit tags by a single string. More...
 
bool hasUnitTag (const qsf::StringHash &tag) const
 Check for presence of a specific unit tag. More...
 
uint32 getNameSpace () const
 Get name space of the order information. More...
 
void setNameSpace (uint32 space)
 Set name space of the order information. More...
 
const std::string & getAvatarIcon () const
 Return the avatar icon asset to use. More...
 
void setAvatarIcon (const std::string &name)
 Set the avatar icon name to use. More...
 
const std::string & getSelectionIcon () const
 Return the selection icon name to use. More...
 
void setSelectionIcon (const std::string &name)
 Set the selection icon name to use. More...
 
const std::string & getMiniMapIconType () const
 Get the mini map icon type. More...
 
void setMiniMapIconType (const std::string &miniMapIconType)
 Set the mini map icon type. More...
 
uint32 getOrderCost () const
 Return the order cost of the unit in ingame credits. More...
 
void setOrderCost (uint32 orderCost)
 Set the order cost of the unit in ingame credits. More...
 
int getOrderSpeed () const
 Return the order speed of the unit in seconds // TODO(mk) find a good value for speed. More...
 
void setOrderSpeed (int orderSpeed)
 Set the order speed of the unit in seconds. More...
 
uint32 getUnlockCost () const
 Return the amount of credits it costs to unlock the unit. More...
 
void setUnlockCost (uint32 unlockCost)
 Set the amount of credits it cost to unlock the unit. More...
 
uint32 getNumberAvailable () const
 Return the maximum number of units are available for the player. More...
 
void setNumberAvailable (uint32 numberAvailable)
 Set the maximum number of units are available for the player. More...
 
uint32 getPersonnelSpace () const
 Return the maximum number of controllable personnel, like medics or firefighters of the unit. More...
 
void setPersonnelSpace (uint32 personnelSpace)
 Set the maximum number of controllable personnel, like medics or firefighters of the unit. More...
 
uint32 getPassengerSpace () const
 Return the maximum number of passengers, like injured persons or gangsters. More...
 
void setPassengerSpace (uint32 passengerSpace)
 Set the maximum number of passengers of the unit. More...
 
void setStartPersonnel (const boost::property_tree::ptree &pTree)
 Read the start personnel from pTree. More...
 
const boost::property_tree::ptreegetStartPersonnel () const
 Return the pTree of the start personnel, needed for loading data from .json; use "getStartPersonnelList()" instead. More...
 
const OrderPairListgetStartPersonnelList () const
 Return the list with start personnel (name / number) More...
 
OrderPairListgetStartPersonnelListForWriting ()
 Return the list with start personnel (name / number) More...
 
std::string getSupportedPersonnelAsString () const
 Return the pTree of the supported personnel, needed for loading data from .json. More...
 
void setSupportedPersonnelAsString (const std::string &supported)
 Read the supported personnel from a single, space-separated string. More...
 
bool supportsPersonnel (const std::string &personnelUnitTypeName) const
 Check whether this is a vehicle and if a given type of unit persons can enter this. More...
 
uint32 getSpeakerIndex () const
 Returns the speaker index which should be used for e.g. the voice feedback. More...
 
void setSpeakerIndex (uint32 speakerIndex)
 Set the speaker index which should be used for e.g. the voice feedback. 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 void getOrderPairListByVehicleComponent (const VehicleComponent &vehicleComponent, OrderPairList &orderPairList)
 

Public Attributes

std::vector< std::string > mHelpPages
 

Additional Inherited Members

- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. More...
 

Detailed Description

Order information.

Remarks
The order information class describes an ingame entity the player can order, this is (usually) selectable and commandable. This can be a vehicle, helicopter, ship or a person. In the future maybe buildings and equipment. This has icons for representing in the GUI.

Member Typedef Documentation

typedef std::pair<std::string, uint32> em5::OrderInfo::OrderPair
typedef boost::container::flat_map<std::string, uint32> em5::OrderInfo::OrderPairList

Constructor & Destructor Documentation

em5::OrderInfo::OrderInfo ( uint32  key)
explicit

Constructor.

virtual em5::OrderInfo::~OrderInfo ( )
virtual

Destructor.

Member Function Documentation

const std::string& em5::OrderInfo::getAvatarIcon ( ) const

Return the avatar icon asset to use.

Returns
The avatar icon asset to use (e.g. "sample/texture/animal/squirrel"), do no destroy the returned instance
Note
  • Connected to the CAMP reflection system
units::Department em5::OrderInfo::getDepartment ( ) const

Get the department.

const std::string& em5::OrderInfo::getDepartmentAsString ( ) const

Get the department name.

const std::string& em5::OrderInfo::getLocalizedName ( ) const

Get the localized name ID.

Note
  • This is a name for display to the user; note that this is only the text ID, which still needs to be translated with e.g. QSF_TRANSLATE_STRING
const std::string& em5::OrderInfo::getMiniMapIconType ( ) const

Get the mini map icon type.

const std::string& em5::OrderInfo::getName ( ) const

Get name of the order information, e.g. "RW".

Note
  • The order info ID (a.k.a. "unit type ID") is directly related to this name, as it is the name's hash
uint32 em5::OrderInfo::getNameSpace ( ) const

Get name space of the order information.

uint32 em5::OrderInfo::getNumberAvailable ( ) const

Return the maximum number of units are available for the player.

Note
  • Connected to the CAMP reflection system
uint32 em5::OrderInfo::getOrderCost ( ) const

Return the order cost of the unit in ingame credits.

Note
  • Connected to the CAMP reflection system
uint32 em5::OrderInfo::getOrderInfoId ( ) const

Get unique order information ID, which is the hashed name.

Note
  • Elsewhere, there order info ID is referred to as "unit type ID", but this is the same thing
static void em5::OrderInfo::getOrderPairListByVehicleComponent ( const VehicleComponent vehicleComponent,
OrderPairList orderPairList 
)
static
int em5::OrderInfo::getOrderSpeed ( ) const

Return the order speed of the unit in seconds // TODO(mk) find a good value for speed.

Note
  • Connected to the CAMP reflection system
uint32 em5::OrderInfo::getPassengerSpace ( ) const

Return the maximum number of passengers, like injured persons or gangsters.

Note
  • Connected to the CAMP reflection system
uint32 em5::OrderInfo::getPersonnelSpace ( ) const

Return the maximum number of controllable personnel, like medics or firefighters of the unit.

Note
  • Connected to the CAMP reflection system
const qsf::AssetProxy& em5::OrderInfo::getPrefab ( ) const

Return the prefab asset to use.

Returns
The prefab asset to use (e.g. "sample/prefab/animal/squirrel"), do no destroy the returned instance
Note
  • Connected to the CAMP reflection system
const std::string& em5::OrderInfo::getSelectionIcon ( ) const

Return the selection icon name to use.

Returns
The selection icon name to use, do no destroy the returned instance
Note
  • Connected to the CAMP reflection system
uint32 em5::OrderInfo::getSpeakerIndex ( ) const

Returns the speaker index which should be used for e.g. the voice feedback.

const boost::property_tree::ptree& em5::OrderInfo::getStartPersonnel ( ) const

Return the pTree of the start personnel, needed for loading data from .json; use "getStartPersonnelList()" instead.

Note
  • Connected to the CAMP reflection system
const OrderPairList& em5::OrderInfo::getStartPersonnelList ( ) const

Return the list with start personnel (name / number)

OrderPairList& em5::OrderInfo::getStartPersonnelListForWriting ( )

Return the list with start personnel (name / number)

std::string em5::OrderInfo::getSupportedPersonnelAsString ( ) const

Return the pTree of the supported personnel, needed for loading data from .json.

Note
  • Connected to the CAMP reflection system
std::string em5::OrderInfo::getUnitTagsAsString ( ) const

Get unit tags as a single string.

Note
  • There can be multiple unit tags for an order info, which get merged into a single, space-separated string, e.g. "Firefighters Vehicle Road RW"
uint32 em5::OrderInfo::getUnlockCost ( ) const

Return the amount of credits it costs to unlock the unit.

Note
  • Connected to the CAMP reflection system
bool em5::OrderInfo::hasUnitTag ( const qsf::StringHash tag) const

Check for presence of a specific unit tag.

void em5::OrderInfo::setAvatarIcon ( const std::string &  name)

Set the avatar icon name to use.

Parameters
[in]nameThe avatar icon name to use
Note
  • Connected to the CAMP reflection system
void em5::OrderInfo::setDepartment ( units::Department  department)

Set the department.

void em5::OrderInfo::setDepartmentAsString ( const std::string &  department)

Set the department by name.

void em5::OrderInfo::setLocalizedName ( const std::string &  name)

Set the localized name ID.

void em5::OrderInfo::setMiniMapIconType ( const std::string &  miniMapIconType)

Set the mini map icon type.

void em5::OrderInfo::setName ( const std::string &  name)

Set name of the order information.

void em5::OrderInfo::setNameSpace ( uint32  space)

Set name space of the order information.

void em5::OrderInfo::setNumberAvailable ( uint32  numberAvailable)

Set the maximum number of units are available for the player.

Note
  • Connected to the CAMP reflection system
void em5::OrderInfo::setOrderCost ( uint32  orderCost)

Set the order cost of the unit in ingame credits.

Note
  • Connected to the CAMP reflection system
void em5::OrderInfo::setOrderSpeed ( int  orderSpeed)

Set the order speed of the unit in seconds.

Note
  • Connected to the CAMP reflection system
void em5::OrderInfo::setPassengerSpace ( uint32  passengerSpace)

Set the maximum number of passengers of the unit.

Note
  • Connected to the CAMP reflection system
void em5::OrderInfo::setPersonnelSpace ( uint32  personnelSpace)

Set the maximum number of controllable personnel, like medics or firefighters of the unit.

Note
  • Connected to the CAMP reflection system
void em5::OrderInfo::setPrefab ( const qsf::AssetProxy prefab)

Set the prefab asset to use.

Parameters
[in]prefabThe prefab asset to use (e.g. "sample/prefab/animal/squirrel")
Note
  • Connected to the CAMP reflection system
void em5::OrderInfo::setSelectionIcon ( const std::string &  name)

Set the selection icon name to use.

Parameters
[in]nameThe selection icon name to use
Note
  • Connected to the CAMP reflection system
void em5::OrderInfo::setSpeakerIndex ( uint32  speakerIndex)

Set the speaker index which should be used for e.g. the voice feedback.

void em5::OrderInfo::setStartPersonnel ( const boost::property_tree::ptree pTree)

Read the start personnel from pTree.

void em5::OrderInfo::setSupportedPersonnelAsString ( const std::string &  supported)

Read the supported personnel from a single, space-separated string.

void em5::OrderInfo::setUnitTagsAsString ( const std::string &  unitTags)

Set unit tags by a single string.

Note
  • The unit tags string is expected as space-separated string, e.g. "Firefighters Vehicle Road RW"
void em5::OrderInfo::setUnlockCost ( uint32  unlockCost)

Set the amount of credits it cost to unlock the unit.

Note
  • Connected to the CAMP reflection system
bool em5::OrderInfo::supportsPersonnel ( const std::string &  personnelUnitTypeName) const

Check whether this is a vehicle and if a given type of unit persons can enter this.

Remarks
This checks both standard personnel and supported personnel properties and returns "true" if the given personnel unit name is listed in any of these

Member Data Documentation

std::vector<std::string> em5::OrderInfo::mHelpPages

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