Emergency 20 Dokumentation  4.2.0
em5::MoveAction Class Reference

EMERGENCY 5 move action. More...

#include <MoveAction.h>

Inheritance diagram for em5::MoveAction:
qsf::ai::MoveAction qsf::Action qsf::Object em5::LoadRobotToTransporterAction

Public Member Functions

 MoveAction ()
 Default constructor. More...
 
virtual ~MoveAction ()
 Destructor. More...
 
void init (qsf::ai::NavigationGoal *goal, uint32 movementModeId=qsf::getUninitialized(static_cast< uint32 >(0)), qsf::ai::Path *path=nullptr, qsf::Time maxMoveTime=qsf::Time::ZERO)
 Initialization. More...
 
float getPathLength () const
 Calculate the length of the navigation path. TAKE CARE: This will only return values > 0 once the path exists. Which is after the MoveAction has been updated once. More...
 
uint64 getFollowedEntity () const
 Return the target entity which is followed; "qsf::getUninitialized<uint64>()" if nothing is followed. More...
 
void forceFollowedEntityToWait (float distance, qsf::Time waitTime)
 Force a followed entity to wait when we reach a certain distance. More...
 
virtual void serialize (qsf::BinarySerializer &serializer) override
 Serialize or deserialize the action using a binary serializer. More...
 
virtual bool onStartup () override
 Called when the action gets active (i.e. switches to the "running" state) for the first time. More...
 
virtual void onShutdown () override
 Called before the action gets removed, in case it was active at least once since its creation. More...
 
- Public Member Functions inherited from qsf::ai::MoveAction
 MoveAction ()
 
void init (NavigationGoal *goal, unsigned int movementModeId=getUninitialized< unsigned int >(), Path *path=nullptr)
 
void setReactionToFailedGoal (action::Result reaction)
 
unsigned int getMovementModeId () const
 
virtual void onPause () override
 Called when the action gets interrupted by another action, but not removed. More...
 
virtual void onResume () override
 Called when the action gets active again after it was paused. 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 Attributes

static const qsf::NamedIdentifier ACTION_ID
 "em5::MoveAction" unique action identifier More...
 
static const float MIN_DISTANCE_FOR_RETRY
 Minimal distance for retrying the pathfinding. More...
 
- Static Public Attributes inherited from qsf::ai::MoveAction
static const NamedIdentifier ACTION_ID
 

Protected Member Functions

virtual qsf::action::Result updateAction (const qsf::Clock &clock) override
 Update the action. More...
 
- Protected Member Functions inherited from qsf::ai::MoveAction
 MoveAction (uint32 actionId)
 
const WeakPtr< NavigationComponent > & getNavigationComponent () const
 
std::auto_ptr< NavigationGoal > & getGoal ()
 
- Protected Member Functions inherited from qsf::Action
 Action (uint32 actionTypeId)
 Constructor. More...
 
virtual void onAbort ()
 Called before the action gets removed, in case it was never active. 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 move action.

Constructor & Destructor Documentation

em5::MoveAction::MoveAction ( )

Default constructor.

virtual em5::MoveAction::~MoveAction ( )
virtual

Destructor.

Member Function Documentation

void em5::MoveAction::forceFollowedEntityToWait ( float  distance,
qsf::Time  waitTime 
)

Force a followed entity to wait when we reach a certain distance.

Parameters
[in]distanceDistance at which we force the target to wait
[in]waitTimeTime we force a target to wait
uint64 em5::MoveAction::getFollowedEntity ( ) const

Return the target entity which is followed; "qsf::getUninitialized<uint64>()" if nothing is followed.

float em5::MoveAction::getPathLength ( ) const

Calculate the length of the navigation path. TAKE CARE: This will only return values > 0 once the path exists. Which is after the MoveAction has been updated once.

void em5::MoveAction::init ( qsf::ai::NavigationGoal goal,
uint32  movementModeId = qsf::getUninitialized(static_cast< uint32 >(0)),
qsf::ai::Path path = nullptr,
qsf::Time  maxMoveTime = qsf::Time::ZERO 
)

Initialization.

Parameters
[in]goalNavigation goal with its configurations for this movement, should only be null if the path parameter is not null
[in]movementModeIdMovement mode identifier, choose movement modes from "em5/ai/MovementModes.h", usually used to run or use different navigation maps
[in]pathNavigation path if we already have a path we follow, for example from "AiPathComponent::createAiPathSmoothed()"
[in]maxMoveTimeMaximal time before we stop the movement and finish the action. If time is zero we will run as long as it needs to reach the goal or fail
virtual void em5::MoveAction::onShutdown ( )
overridevirtual

Called before the action gets removed, in case it was active at least once since its creation.

Remarks
This method is called only if the action to be removed got an onStartup() call before; if this was not the case, onAbort() gets called instead

Reimplemented from qsf::ai::MoveAction.

Reimplemented in em5::LoadRobotToTransporterAction.

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

Called when the action gets active (i.e. switches to the "running" state) for the first time.

Returns
true if startup succeeded, false otherwise

Reimplemented from qsf::ai::MoveAction.

Reimplemented in em5::LoadRobotToTransporterAction.

virtual void em5::MoveAction::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::ai::MoveAction.

Reimplemented in em5::LoadRobotToTransporterAction.

virtual qsf::action::Result em5::MoveAction::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

Reimplemented from qsf::ai::MoveAction.

Reimplemented in em5::LoadRobotToTransporterAction.

Member Data Documentation

const qsf::NamedIdentifier em5::MoveAction::ACTION_ID
static

"em5::MoveAction" unique action identifier

const float em5::MoveAction::MIN_DISTANCE_FOR_RETRY
static

Minimal distance for retrying the pathfinding.


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