Emergency 20 Dokumentation  4.2.0
em5::SpawnUnitAction Class Reference

EMERGENCY 5 spawn unit action. More...

#include <SpawnUnitAction.h>

Inheritance diagram for em5::SpawnUnitAction:
qsf::Action qsf::Object

Public Member Functions

 SpawnUnitAction ()
 Default constructor. More...
 
virtual ~SpawnUnitAction ()
 Destructor. More...
 
void init (const OrderInfo &orderInfo, const glm::vec3 &targetPosition, Player *player, const OrderInfo::OrderPairList &orderPairList=OrderInfo::OrderPairList(), int index=1, int maxIndex=1, const glm::quat *targetRotation=nullptr, uint64 userData=qsf::getUninitialized< uint64 >())
 Initialize action with values. More...
 
virtual void serialize (qsf::BinarySerializer &serializer) override
 Serialize or deserialize the action using a binary serializer. More...
 
- Public Member Functions inherited from qsf::Action
virtual ~Action ()
 Destructor. More...
 
uint32 getTypeId () const
 Return the action's type ID. More...
 
ActionComponentgetComponent () const
 Return the owning action component. More...
 
EntitygetEntity () const
 Return the owning entity. More...
 
uint64 getEntityId () const
 Return the owning entity's ID. More...
 
MapgetMap () const
 Return the map the action's owning entity is in. More...
 
process::State getState () const
 Return the action's process state. More...
 
action::Result update (const Clock &clock)
 Update the action. More...
 
void shutdown ()
 Called before the action gets removed. More...
 
void pause ()
 Called when the action gets interrupted by another action, but not removed. More...
 
action::Priority getPriority () const
 Get action priority. More...
 
void setPriority (action::Priority priority)
 Set action priority. 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 setupCreatedEntityAsUnitVehicle (qsf::Entity &newOrderedUnit, qsf::Entity &spawnPointEntity, const OrderInfo &orderInfo, const Player &player)
 Setups the newly created entity as unit vehicle and sets the initial position. More...
 
static void setupCreatedEntityAsUnitVehicle (qsf::Entity &newOrderedUnit, const qsf::Transform &transform, const OrderInfo &orderInfo, const Player &player)
 
static void setupCreatedEntityAsUnitVehicle (qsf::Entity &newOrderedUnit, const OrderInfo &orderInfo, const Player &player)
 
static void registerPersonnelInSpawn (const OrderInfo &orderInfo, const OrderInfo::OrderPair &orderPair, const Player &player)
 
static void fillVehicleWithStartPersonnel (qsf::Entity &vehicleEntity, const OrderInfo &orderInfo, const Player &player, OrderInfo::OrderPairList *orderPairList=nullptr, uint64 spawnpointEntityId=qsf::getUninitialized< uint64 >(), uint64 userData=qsf::getUninitialized< uint64 >())
 
static void setupCreatedEntityAsUnitPerson (qsf::Entity &newOrderedUnit, qsf::Entity *vehicleEntity, const OrderInfo &orderInfo, const Player &player, bool hidden=true)
 Setups the newly created entity as unit person. More...
 
static void setupCreatedEntityAsUnit (qsf::Entity &newOrderedUnit, const OrderInfo &orderInfo, const Player &player)
 Setups the newly created entity as unit. More...
 
static void sendUnitSpawnedMessage (const qsf::Entity &newOrderedUnit, uint64 spawnpointEntityId, uint64 userData)
 
static void sendUnitSpawnedPlayerUpdateSelectionMessage (uint32 playerId, uint64 spawnedUnitEntityId)
 

Static Public Attributes

static const qsf::NamedIdentifier ACTION_ID
 "em5::SpawnUnitAction" unique action identifier More...
 

Protected Member Functions

virtual qsf::action::Result updateAction (const qsf::Clock &clock) override
 Update the action. More...
 
- Protected Member Functions inherited from qsf::Action
 Action (uint32 actionTypeId)
 Constructor. More...
 
virtual bool onStartup ()
 Called when the action gets active (i.e. switches to the "running" state) for the first time. More...
 
virtual void onShutdown ()
 Called before the action gets removed, in case it was active at least once since its creation. More...
 
virtual void onAbort ()
 Called before the action gets removed, in case it was never active. More...
 
virtual void onPause ()
 Called when the action gets interrupted by another action, but not removed. More...
 
virtual void onResume ()
 Called when the action gets active again after it was paused. More...
 
- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. More...
 

Additional Inherited Members

- 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 Attributes inherited from qsf::Action
action::Priority mPriority
 Action with higher priority get evaluated first; default value is 100. More...
 
bool mIsScriptAction
 True if action is loaded via script. More...
 

Detailed Description

EMERGENCY 5 spawn unit action.

Note
  • This action is pushed to entities with spawn point components, it creates an entity of the given type and handles animation

Constructor & Destructor Documentation

em5::SpawnUnitAction::SpawnUnitAction ( )

Default constructor.

virtual em5::SpawnUnitAction::~SpawnUnitAction ( )
virtual

Destructor.

Member Function Documentation

static void em5::SpawnUnitAction::fillVehicleWithStartPersonnel ( qsf::Entity vehicleEntity,
const OrderInfo orderInfo,
const Player player,
OrderInfo::OrderPairList orderPairList = nullptr,
uint64  spawnpointEntityId = qsf::getUninitializeduint64 >(),
uint64  userData = qsf::getUninitializeduint64 >() 
)
static
void em5::SpawnUnitAction::init ( const OrderInfo orderInfo,
const glm::vec3 &  targetPosition,
Player player,
const OrderInfo::OrderPairList orderPairList = OrderInfo::OrderPairList(),
int  index = 1,
int  maxIndex = 1,
const glm::quat *  targetRotation = nullptr,
uint64  userData = qsf::getUninitializeduint64 >() 
)

Initialize action with values.

static void em5::SpawnUnitAction::registerPersonnelInSpawn ( const OrderInfo orderInfo,
const OrderInfo::OrderPair orderPair,
const Player player 
)
static
static void em5::SpawnUnitAction::sendUnitSpawnedMessage ( const qsf::Entity newOrderedUnit,
uint64  spawnpointEntityId,
uint64  userData 
)
static
static void em5::SpawnUnitAction::sendUnitSpawnedPlayerUpdateSelectionMessage ( uint32  playerId,
uint64  spawnedUnitEntityId 
)
static
virtual void em5::SpawnUnitAction::serialize ( qsf::BinarySerializer serializer)
overridevirtual

Serialize or deserialize the action using a binary serializer.

Parameters
[in]serializerThe serializer, which can be either in read or write mode

Reimplemented from qsf::Action.

static void em5::SpawnUnitAction::setupCreatedEntityAsUnit ( qsf::Entity newOrderedUnit,
const OrderInfo orderInfo,
const Player player 
)
static

Setups the newly created entity as unit.

Parameters
[in]newOrderedUnitThe newly created entity, which should be setup as a unit
[in]orderInfoThe information about the unit which was ordered
[in]playerThe player, which initiated the unit ordering -> The unit will belong to this player
static void em5::SpawnUnitAction::setupCreatedEntityAsUnitPerson ( qsf::Entity newOrderedUnit,
qsf::Entity vehicleEntity,
const OrderInfo orderInfo,
const Player player,
bool  hidden = true 
)
static

Setups the newly created entity as unit person.

Parameters
[in]newOrderedUnitThe newly created entity, which should be setup as a unit
[in]vehicleEntityThe vehicle entity to which the unit person belongs (optional, may be a null pointer)
[in]orderInfoThe information about the unit which was ordered
[in]playerThe player, which initiated the unit ordering -> The unit will belong to this player
[in]hiddenHide the entity?
static void em5::SpawnUnitAction::setupCreatedEntityAsUnitVehicle ( qsf::Entity newOrderedUnit,
qsf::Entity spawnPointEntity,
const OrderInfo orderInfo,
const Player player 
)
static

Setups the newly created entity as unit vehicle and sets the initial position.

Parameters
[in]newOrderedUnitThe newly created entity, which should be setup as a unit
[in]spawnPointEntityThe spawn point entity from which the unit should "enter" the map
[in]orderInfoThe information about the unit which was ordered
[in]playerThe player, which initiated the unit ordering -> The unit will belong to this player
static void em5::SpawnUnitAction::setupCreatedEntityAsUnitVehicle ( qsf::Entity newOrderedUnit,
const qsf::Transform transform,
const OrderInfo orderInfo,
const Player player 
)
static
static void em5::SpawnUnitAction::setupCreatedEntityAsUnitVehicle ( qsf::Entity newOrderedUnit,
const OrderInfo orderInfo,
const Player player 
)
static
virtual qsf::action::Result em5::SpawnUnitAction::updateAction ( const qsf::Clock clock)
overrideprotectedvirtual

Update the action.

Parameters
clockThe clock used for timing the action updates; holds e.g. time passed since last update
Returns
The result of the action update

Implements qsf::Action.

Member Data Documentation

const qsf::NamedIdentifier em5::SpawnUnitAction::ACTION_ID
static

"em5::SpawnUnitAction" unique action identifier


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