Emergency 20 Dokumentation  4.2.0
em5::GetEquipmentCommand Class Reference

EMERGENCY 5 get equipment command. More...

#include <GetEquipmentCommand.h>

Inheritance diagram for em5::GetEquipmentCommand:
em5::Command qsf::game::Command qsf::Pluginable< CommandManager > qsf::PluginableBase qsf::Object em5::GetAxeCommand em5::GetChainSawCommand em5::GetChainSawHistoricalCommand em5::GetFireExtinguisherCommand em5::GetFireExtinguisherHistoricalCommand em5::GetHandcuffsCommand em5::GetHoseCommand em5::GetHoseHistoricalCommand em5::GetMegaphoneCommand em5::GetPepperSprayCommand em5::GetPistolCommand em5::GetRescueCutterCommand em5::GetSignallingDiscCommand em5::GetSniperRifleCommand em5::GetStunGrenadeCommand em5::GetSwordCommand em5::PlaceBarrierTapeCommand em5::UnequipAllCommand

Public Member Functions

 GetEquipmentCommand (qsf::game::CommandManager *commandManager, uint32 pluginableId)
 Constructor. More...
 
const std::string & getEquipmentName ()
 
virtual bool checkAvailable () override
 Check whether the command is currently available at all. More...
 
virtual bool checkCaller (qsf::Entity &caller) override
 Check whether the command can be executed by the given caller entity. More...
 
virtual void execute (const qsf::game::CommandContext &context) override
 Execute command for given context. More...
 
- Public Member Functions inherited from em5::Command
virtual const IconSettingsgetIconSettings () const
 
virtual bool highlightTarget () const
 Indicates if target highlighting for this command is enabled/disabled. More...
 
const std::string & getHelpPageName () const
 Returns the help page name. More...
 
int32 getButtonPriority () const
 Returns the priority of the command buttons (Bigger priority comes first) More...
 
- Public Member Functions inherited from qsf::game::Command
 Command (CommandManager *commandManager, uint32 commandId)
 Constructor. More...
 
uint32 getId () const
 Get command ID, which is the command class's PLUGINABLE_ID. More...
 
uint32 getPriority () const
 Get command priority. More...
 
bool getIsScriptCommand () const
 Returns true if command is created via script. More...
 
virtual bool checkContext (const CommandContext &context)=0
 Check whether the command can be executed with the given context. More...
 
virtual std::string getName () const
 Returns the name of the command. More...
 
- Public Member Functions inherited from qsf::Pluginable< CommandManager >
virtual ~Pluginable ()
 Destructor. More...
 
CommandManager & getManager () const
 Return the pluginable manager this pluginable is in. More...
 
- Public Member Functions inherited from qsf::PluginableBase
virtual ~PluginableBase ()
 Destructor. More...
 
template<typename T >
T & getPluginableManager () const
 Return the pluginable manager this pluginable is in. 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...
 

Protected Member Functions

void executeFromVehicle (const qsf::game::CommandContext &context)
 Used for the get equipment from vehicle variant of get equipment. More...
 
void startAction (const qsf::game::CommandContext &context, const qsf::Entity &targetEntity) const
 
void startAction (const qsf::game::CommandContext &context) const
 
em5::RoadVehicleComponentfindVehicleComponent (const qsf::game::CommandContext &context) const
 
- Protected Member Functions inherited from em5::Command
 Command (qsf::game::CommandManager *commandManager, uint32 commandId)
 Constructor. More...
 
bool checkCallerActionPriorityNoBlocking (qsf::Entity &caller, uint32 maximumPriority) const
 Modification of the "checkCallerActionPriority" but return "false" if callers action is with blocking priority. More...
 
- Protected Member Functions inherited from qsf::game::Command
bool checkCallerActionPriority (Entity &caller, uint32 maximumPriority) const
 
ActionComponentgetActionComponent (Entity &caller) const
 
- Protected Member Functions inherited from qsf::Pluginable< CommandManager >
 Pluginable (CommandManager *pluginableManager)
 Constructor. More...
 
- Protected Member Functions inherited from qsf::PluginableBase
 PluginableBase (PluginableManager *pluginableManager)
 Constructor. More...
 
- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. More...
 

Protected Attributes

std::string mEquipmentName
 The name of the equipment, internally we use defines. More...
 
- Protected Attributes inherited from em5::Command
IconSettings mIconSettings
 The command's icon settings structure. More...
 
std::string mHelpPageName
 Holds the corresponding help page name. More...
 
int32 mButtonPriority
 Priority of command buttons on screen (Bigger priority comes first) More...
 
- Protected Attributes inherited from qsf::game::Command
uint32 mPriority
 Commands with higher priority get evaluated first; default value is 100. More...
 
bool mIsScriptCommand
 True if command is loaded via script. 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 }
 

Detailed Description

EMERGENCY 5 get equipment command.

Constructor & Destructor Documentation

em5::GetEquipmentCommand::GetEquipmentCommand ( qsf::game::CommandManager commandManager,
uint32  pluginableId 
)

Constructor.

Member Function Documentation

virtual bool em5::GetEquipmentCommand::checkAvailable ( )
overridevirtual

Check whether the command is currently available at all.

Returns
"true" if command can be executed, "false" if it is blocked or makes no sense in the current game state

Implements qsf::game::Command.

Reimplemented in em5::PlaceBarrierTapeCommand.

virtual bool em5::GetEquipmentCommand::checkCaller ( qsf::Entity caller)
overridevirtual

Check whether the command can be executed by the given caller entity.

Parameters
[in]callerThe caller entity to check
Returns
"true" if command can be executed by this entity, "false" if the entity is not able to execute the command (at all or in the current situation)
Remarks
This only gets called in case checkAvailable() returned "true", so don't repeat checks from checkAvailable() in checkCaller().

Implements qsf::game::Command.

Reimplemented in em5::PlaceBarrierTapeCommand.

virtual void em5::GetEquipmentCommand::execute ( const qsf::game::CommandContext context)
overridevirtual

Execute command for given context.

Parameters
[in]contextThe command context, including caller and target information
Remarks
This only gets called if all three checks returned "true". Command execution usually consists of pushing new actions to the caller entity's action component.

Implements qsf::game::Command.

Reimplemented in em5::PlaceBarrierTapeCommand, em5::UnequipAllCommand, em5::GetHoseCommand, em5::GetHoseHistoricalCommand, em5::GetAxeCommand, em5::GetChainSawCommand, em5::GetChainSawHistoricalCommand, em5::GetFireExtinguisherCommand, em5::GetFireExtinguisherHistoricalCommand, em5::GetRescueCutterCommand, em5::GetPistolCommand, em5::GetSniperRifleCommand, and em5::GetSwordCommand.

void em5::GetEquipmentCommand::executeFromVehicle ( const qsf::game::CommandContext context)
protected

Used for the get equipment from vehicle variant of get equipment.

em5::RoadVehicleComponent* em5::GetEquipmentCommand::findVehicleComponent ( const qsf::game::CommandContext context) const
protected
const std::string& em5::GetEquipmentCommand::getEquipmentName ( )
void em5::GetEquipmentCommand::startAction ( const qsf::game::CommandContext context,
const qsf::Entity targetEntity 
) const
protected
void em5::GetEquipmentCommand::startAction ( const qsf::game::CommandContext context) const
protected

Member Data Documentation

std::string em5::GetEquipmentCommand::mEquipmentName
protected

The name of the equipment, internally we use defines.


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