Emergency 20 Dokumentation  4.2.0
em5::FireComponent Class Reference

EMERGENCY 5 fire component class. More...

#include <FireComponent.h>

Inheritance diagram for em5::FireComponent:
em5::FireReceiverComponent qsf::Component qsf::InheritedObject qsf::WeakPtrTarget qsf::Object

Public Types

enum  FireState {
  FIRESTATE_NOFIRE, FIRESTATE_SMALLFIRE, FIRESTATE_LARGEFIRE, FIRESTATE_DESTROYED,
  _NUM_FIRESTATES
}
 
enum  FireAudioState {
  FIREAUDIOSTATE_NOFIRE, FIREAUDIOSTATE_SMALLFIRE, FIREAUDIOSTATE_MEDUIMFIRE, FIREAUDIOSTATE_LARGEFIRE,
  _NUM_FIREAUDIOSTATES
}
 
- Public Types inherited from qsf::Component
enum  TransformChangeFlag {
  TRANSFORM_CHANGE_POSITION = 0x01, TRANSFORM_CHANGE_ROTATION = 0x02, TRANSFORM_CHANGE_SCALE = 0x04, TRANSFORM_CHANGE_TRANSFORM = 0x07,
  TRANSFORM_CHANGE_FOR_SIMULATION = 0x08, TRANSFORM_CHANGE_FOR_ANIMATION = 0x10
}
 
typedef BitFlagSet< uint8, TransformChangeFlagTransformChangeFlags
 
- 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

 FireComponent (qsf::Prototype *prototype)
 Constructor. More...
 
virtual ~FireComponent ()
 Destructor. More...
 
qsf::EntitygetMainEntity () const
 Return the main entity of this fire component. More...
 
ComplexFireComponentgetComplexFireComponent () const
 Return the complex fire component this belongs to. More...
 
void showOnExplosionFireParticles ()
 Show the particles which are edited as show on explosion Usually no need to call this manually, but needed by the DamageComonent::onExplosion derivatives. More...
 
float getRelativeCombustionEnergy () const
 
float getEnergy () const
 Return the energy of the fire. More...
 
void setEnergy (float energy)
 Set the energy of the fire. More...
 
void setEnergyPercent (float fraction)
 
float getMaxEnergyValue () const
 
float getEnergyPercent () const
 Get the fire's current fire energy in interval [0.0, 1.0]. More...
 
float getTotalDamage () const
 Return the amount of energy the fire has damage the entity. More...
 
void setTotalDamage (float damage)
 Set the total damage value of the entity, if higher than getLife() of "em5::FireMaterial", entity is destroyed. More...
 
float getTotalDamagePercentage () const
 
float getMaximumLife () const
 Return the maximum life of the fire material. More...
 
FireState getFireState () const
 Return the current fire state. More...
 
void setFireState (FireState fireState)
 Set the current fire state. Show or hide the necessary graphics, like particles or building destruction. More...
 
void setFireStateByEvent (FireState fireState, FreeplayEvent *freeplayEvent=nullptr)
 Set fire state by event. More...
 
const std::string & getFireMaterialName () const
 Return the name of the fire material asset to use. More...
 
void setFireMaterialByName (const std::string &fireMaterialName)
 Set the name of the fire material asset to use. More...
 
float getHardRadius () const
 Return the hard fire radius in meters; objects inside the hard radius take full fire damage. More...
 
void setHardRadius (float hardRadius)
 Set the hard fire radius. More...
 
float getSoftRadius () const
 Return the soft fire radius in meters; objects inside the soft radius take less damage fire damage. More...
 
void setSoftRadius (float softRadius)
 Set the soft fire radius. More...
 
bool getPlayAudio ()
 Returns if fire sounds are playing for this component. More...
 
void setPlayAudio (bool playAudio)
 Set if fire sounds are playing for this component. More...
 
bool isIntact () const
 Return if the entity is still intact, i.e. has not burned before. More...
 
virtual bool isBurning () const override
 Return "true" if the fire is active, in this case the fire will charge by themselves. More...
 
virtual bool isBurned () const override
 Returns "true" if the total amount of material energy is used; in this case the fire is over. More...
 
bool isBurnable () const
 Returns "true" if the fire component is burnable at all. More...
 
float getExplosionBlastForce () const
 Returns the blast force value of the fire material. More...
 
float getExplosionBlastRadius () const
 Returns the blast radius of the fire material. More...
 
float getFireResistance () const
 Returns the fire resistance of the fire material. More...
 
float getReceivedEnergyFactor () const
 Returns the received energy factor. More...
 
void setReceivedEnergyFactor (float factor)
 Set the received energy factor. More...
 
bool isReadyForCleanup () const
 Return true if the component is not on fire and it doesn't plan to start a fire. Must get fire damage one time. More...
 
void cleanup ()
 Reset the fire component so it will burn again. More...
 
void startFire (FreeplayEvent *freeplayEvent)
 Set the entity on fire. Use this as easy access function, it's also possible to set the fire state directly. More...
 
void stopFire ()
 Immediately stops the fire. Use this as easy access function, it's also possible to set the fire state directly. More...
 
void destroyByFire ()
 Immediately destroy the entity. Use this as easy access function, it's also possible to set the fire state directly. More...
 
void triggerExplosion ()
 Immediately destroy the entity, with an explosion if the material is edited with one. Use this as easy access function, it's also possible to set the fire state directly. More...
 
void hideParticleChildrenAtMapSave ()
 Hide the particle of the linked entities. More...
 
void forceFireDamage (float fireDamage)
 Give fire damage to the component, use this only for debug reasons. More...
 
void updateParticlesVisibility ()
 
bool isExtinguishBlocked () const
 
void setExtinguishBlocked (bool extinguishBlocked)
 
void setShowFireRadii (bool showFireRadii)
 Activate/Deactivate displaying the fire radii (only needed for the editor) More...
 
void addFireRadiiDebugDrawRequests (qsf::DebugDrawProxy &debugDrawProxy)
 Adds debug draw requests for the fire radii to the given debug draw proxy. More...
 
void setFireEnergyAndDamageRestrictionPercentage (float limitPercentage)
 Sets a limit for the fire energy and fire damage (Percentage value -> When limit reached any further extinguishing doesn't have any effect or any additional damage by fire is ignored) More...
 
virtual bool canCountedForExtinguishAchievement () const override
 Is the current fire component counted for the extinguish fires achievement. More...
 
virtual void setCountedForExtinguishAchievement (bool canCounted) override
 Enable or disable counting for the extinguishing fires achievement. More...
 
- Public Member Functions inherited from em5::FireReceiverComponent
 FireReceiverComponent (qsf::Prototype *prototype)
 Constructor. More...
 
virtual ~FireReceiverComponent ()
 Destructor. More...
 
virtual void addCoolingEnergySource (uint64 entityId, float extinguishEnergy, float coolingEnergy)
 Adds the entity and its cooling energy. More...
 
virtual void removeCoolingEnergySource (uint64 entityId)
 Removes the entity and its cooling energy. More...
 
float getCoolingEnergy () const
 Returns the amount of cooling energy which is currently applied to this component. More...
 
uint32 getCoolingEnergySourceCount () const
 Returns the amount of cooling energy sources that interact with this component. More...
 
void getCoolingSources (std::vector< uint64 > &coolingSourceIds) const
 
qsf::TransformComponentgetTransformComponent () const
 Returns the owning entity's transform component, in case this component is in simulating state. More...
 
- Public Member Functions inherited from qsf::Component
virtual ~Component ()
 Destructor. More...
 
PrototypegetPrototype () const
 Return the prototype this component is in. More...
 
EntitygetEntity () const
 Return a reference to the entity this component is in. More...
 
uint32 getId () const
 Return the unique component identifier. More...
 
ComponentManagergetComponentManager () const
 Return the component manager that's responsible for this component instance. More...
 
ComponentCollectiongetComponentCollection () const
 Return the component collection that's responsible for this component instance. More...
 
bool isSimulating () const
 Return whether or not the component is in simulating mode. More...
 
bool isActive () const
 Return whether or not the component is considered to be active. More...
 
void setActive (bool active)
 Set whether or not the component is considered to be active. More...
 
bool isDebug () const
 Return whether or not the component is considered to be in debug mode. More...
 
bool isHidden () const
 Return whether or not the component is hidden. More...
 
void setHidden (bool hidden)
 Set whether or not the component is hidden. More...
 
bool isGloballyHidden () const
 Return whether or not the component is globally hidden. More...
 
void setGloballyHidden (bool globallyHidden)
 Set whether or not the component is globally hidden. More...
 
bool isReallyHidden () const
 Return whether or not the component is really hidden. More...
 
bool startup (bool ownerIsRunning)
 Startup the component. More...
 
bool isRunning () const
 Return whether or not the component is up-and-running. More...
 
void shutdown ()
 Shutdown the component. More...
 
uint64 getPrototypeId () const
 Return the ID of the prototype this component is in. More...
 
uint64 getEntityId () const
 Return the ID of the entity this component is in. More...
 
virtual void onInvalidation ()
 Invalidate the component. More...
 
virtual void setDebug (bool debugMode)
 Set whether or not the component is considered to be in debug mode. More...
 
virtual void serialize (BinarySerializer &serializer)
 Serialize or deserialize the component using a binary serializer. More...
 
- Public Member Functions inherited from qsf::InheritedObject
void copyPropertyOverrideStateFrom (const InheritedObject &object, bool add=false)
 
void setAllPropertyOverrideFlags (bool value)
 
void autoCreatePropertyOverrideState ()
 
virtual camp::Value getPropertyDefaultValue (const StringHash &propertyId) const override
 
virtual PropertyOverrideState getPropertyOverrideState (const StringHash &propertyId) const override
 
virtual bool setPropertyOverrideState (const StringHash &propertyId, PropertyOverrideState overrideState) override
 
- 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 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 bool getAllFireComponents (qsf::Entity &entity, std::vector< FireComponent * > &outFireComponents)
 
static bool isBurningFireState (FireState fireState)
 

Static Public Attributes

static const uint32 COMPONENT_ID
 "em5::FireComponent" unique component ID More...
 
static const uint32 HARD_RADIUS
 
static const uint32 SOFT_RADIUS
 
- Static Public Attributes inherited from em5::FireReceiverComponent
static const uint32 COMPONENT_ID
 "em5::FireReceiverComponent" unique component ID More...
 
- Static Public Attributes inherited from qsf::Component
static const uint32 COMPONENT_ID
 "qsf::Component" unique component ID More...
 

Protected Member Functions

virtual bool checkFireReceiver (qsf::Component *senderComponent) override
 Return "true" if the fire receiver is a valid target for the sender, ask the health component for dead state by default. More...
 
virtual void receiveFireEnergy (float fireEnergy, const qsf::Time &timePassed, qsf::Component *senderComponent) override
 Handle the received energy and gives it to the special receiver. More...
 
virtual void updateSimulation (const qsf::Time &timePassed) override
 Update the simulation state of this component. More...
 
virtual void onSetActive (bool active) override
 Set whether or not the component is considered to be active. More...
 
virtual void onSetSimulating (bool simulating) override
 Set whether or not the component is in simulating mode. More...
 
virtual bool onStartup () override
 Startup the component. More...
 
virtual void onShutdown () override
 Shutdown the component. More...
 
virtual bool implementsOnComponentPropertyChange () const override
 Signal whether this component needs the "onComponentPropertyChange" callback at all. More...
 
virtual void onComponentPropertyChange (const qsf::Component &component, uint32 propertyId) override
 Called in case a component property value was changed. More...
 
- Protected Member Functions inherited from em5::FireReceiverComponent
void internalActive (bool simulating, bool active)
 Updates the registration at the fire system for getting simulation updates and taking part at the fire spread calculation. More...
 
virtual void onComponentTransformChange (const qsf::Transform &transform, TransformChangeFlags flags) override
 Called in case a component transformation value was changed. More...
 
- Protected Member Functions inherited from qsf::Component
 Component (Prototype *prototype)
 Constructor. More...
 
void promotePropertyChange (uint32 propertyId)
 A component property value was changed. More...
 
template<typename T , typename S >
bool assignAndPromoteChange (T &variable, const S &newValue, uint32 propertyId)
 Comfort function for updating an exported member variable and promoting any change that happened. More...
 
void setRegisterForSimulationTransformChanges (bool enable)
 Register or unregister this component as simulation transform listener. More...
 
void setRegisterForAnimationTransformChanges (bool enable)
 Register or unregister this component as animation transform listener. More...
 
virtual const ObjectgetPropertyDefaultsProvider () const override
 
virtual bool ignoreOwnerRunningState () const
 Return whether or not the component will only startup if the owner is in running state. More...
 
virtual void onSetDebug (bool debug)
 Set whether or not the component is considered to be in debug mode. More...
 
virtual void onSetHidden (bool hidden)
 Set whether or not the component is considered to be hidden. More...
 
- Protected Member Functions inherited from qsf::InheritedObject
 InheritedObject ()
 Default constructor. More...
 
- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. More...
 
- Protected Member Functions inherited from qsf::WeakPtrTarget
 WeakPtrTarget ()
 Default constructor. More...
 
 WeakPtrTarget (const WeakPtrTarget &other)
 Copy constructor. More...
 
 WeakPtrTarget (WeakPtrTarget &&)=delete
 Delete the move constructor, as WeakPtrTarget would need a proper move constructor-implementation that ensures that its pointer gets updated in the WeakPtrBase as well. More...
 
 ~WeakPtrTarget ()
 Destructor. More...
 
void invalidateAllWeakPtr ()
 Invalidate all weak pointers to this object. More...
 
void operator= (const WeakPtrTarget &other)
 Copy operator. More...
 

Friends

class ComplexFireComponent
 
class FireSystem
 
class multiplayer::FireData
 

Additional Inherited Members

- Protected Attributes inherited from em5::FireReceiverComponent
qsf::WeakPtr< qsf::TransformComponentmTransformComponent
 
qsf::WeakPtr< HealthComponentmHealthComponent
 
qsf::WeakPtr< DamageComponentmDamageComponent
 
- Protected Attributes inherited from qsf::InheritedObject
std::bitset< 128 > mPropertyOverrideFlags
 One bit for each property; if set, the property is overridden. More...
 

Detailed Description

EMERGENCY 5 fire component class.

Note
  • Most ingame buildings, vehicles, vegetation, objects (cans, garbage) have fire components

Member Enumeration Documentation

Enumerator
FIREAUDIOSTATE_NOFIRE 
FIREAUDIOSTATE_SMALLFIRE 
FIREAUDIOSTATE_MEDUIMFIRE 
FIREAUDIOSTATE_LARGEFIRE 
_NUM_FIREAUDIOSTATES 
Enumerator
FIRESTATE_NOFIRE 

Entity is currently not burning (but may still be damaged by a former fire)

FIRESTATE_SMALLFIRE 

Entity is burning with a small fire, i.e. it's not burning very hot yet.

FIRESTATE_LARGEFIRE 

Entity is burning with a large fire, i.e. it's burning relatively hot now.

FIRESTATE_DESTROYED 

Entity is not burning, but completely destroyed by fire; it can't start burning again because there's nothing left for the fire.

_NUM_FIRESTATES 

Constructor & Destructor Documentation

em5::FireComponent::FireComponent ( qsf::Prototype prototype)
explicit

Constructor.

Parameters
[in]prototypeThe prototype this component is in, no null pointer allowed
virtual em5::FireComponent::~FireComponent ( )
virtual

Destructor.

Member Function Documentation

void em5::FireComponent::addFireRadiiDebugDrawRequests ( qsf::DebugDrawProxy debugDrawProxy)

Adds debug draw requests for the fire radii to the given debug draw proxy.

virtual bool em5::FireComponent::canCountedForExtinguishAchievement ( ) const
overridevirtual

Is the current fire component counted for the extinguish fires achievement.

Reimplemented from em5::FireReceiverComponent.

virtual bool em5::FireComponent::checkFireReceiver ( qsf::Component sender)
overrideprotectedvirtual

Return "true" if the fire receiver is a valid target for the sender, ask the health component for dead state by default.

Reimplemented from em5::FireReceiverComponent.

void em5::FireComponent::cleanup ( )

Reset the fire component so it will burn again.

void em5::FireComponent::destroyByFire ( )

Immediately destroy the entity. Use this as easy access function, it's also possible to set the fire state directly.

void em5::FireComponent::forceFireDamage ( float  fireDamage)

Give fire damage to the component, use this only for debug reasons.

static bool em5::FireComponent::getAllFireComponents ( qsf::Entity entity,
std::vector< FireComponent * > &  outFireComponents 
)
static
ComplexFireComponent * em5::FireComponent::getComplexFireComponent ( ) const
inline

Return the complex fire component this belongs to.

Returns
The parent complex fire component if this is just a child fire component, or null pointer if this is itself the top-level fire component
float em5::FireComponent::getEnergy ( ) const
inline

Return the energy of the fire.

Returns
Returns the current energy value
float em5::FireComponent::getEnergyPercent ( ) const

Get the fire's current fire energy in interval [0.0, 1.0].

float em5::FireComponent::getExplosionBlastForce ( ) const

Returns the blast force value of the fire material.

Note
This method is only needed for the fire spread calculation done via FireSpreadCalculation
float em5::FireComponent::getExplosionBlastRadius ( ) const

Returns the blast radius of the fire material.

Note
This method is only needed for the fire spread calculation done via FireSpreadCalculation
const std::string& em5::FireComponent::getFireMaterialName ( ) const

Return the name of the fire material asset to use.

Note
  • Connected to the CAMP reflection system
float em5::FireComponent::getFireResistance ( ) const

Returns the fire resistance of the fire material.

Note
This method is only needed for the fire spread calculation done via FireSpreadCalculation
FireComponent::FireState em5::FireComponent::getFireState ( ) const
inline

Return the current fire state.

float em5::FireComponent::getHardRadius ( ) const
inline

Return the hard fire radius in meters; objects inside the hard radius take full fire damage.

qsf::Entity& em5::FireComponent::getMainEntity ( ) const

Return the main entity of this fire component.

Returns
Returns the parent entity of this fire component or the entity of this component if there is none
float em5::FireComponent::getMaxEnergyValue ( ) const
float em5::FireComponent::getMaximumLife ( ) const

Return the maximum life of the fire material.

bool em5::FireComponent::getPlayAudio ( )
inline

Returns if fire sounds are playing for this component.

float em5::FireComponent::getReceivedEnergyFactor ( ) const

Returns the received energy factor.

float em5::FireComponent::getRelativeCombustionEnergy ( ) const
float em5::FireComponent::getSoftRadius ( ) const
inline

Return the soft fire radius in meters; objects inside the soft radius take less damage fire damage.

float em5::FireComponent::getTotalDamage ( ) const
inline

Return the amount of energy the fire has damage the entity.

Returns
The total damage value
float em5::FireComponent::getTotalDamagePercentage ( ) const
void em5::FireComponent::hideParticleChildrenAtMapSave ( )

Hide the particle of the linked entities.

Note
This is called by the fire system every time we save the map. We use this to avoid performance issues in editor.
virtual bool em5::FireComponent::implementsOnComponentPropertyChange ( ) const
inlineoverrideprotectedvirtual

Signal whether this component needs the "onComponentPropertyChange" callback at all.

Returns
If "true", this component can receive property change callbacks, otherwise "onComponentPropertyChange" won't get called

Reimplemented from qsf::Component.

bool em5::FireComponent::isBurnable ( ) const
inline

Returns "true" if the fire component is burnable at all.

bool em5::FireComponent::isBurned ( ) const
inlineoverridevirtual

Returns "true" if the total amount of material energy is used; in this case the fire is over.

Reimplemented from em5::FireReceiverComponent.

bool em5::FireComponent::isBurning ( ) const
inlineoverridevirtual

Return "true" if the fire is active, in this case the fire will charge by themselves.

Reimplemented from em5::FireReceiverComponent.

bool em5::FireComponent::isBurningFireState ( FireState  fireState)
inlinestatic
bool em5::FireComponent::isExtinguishBlocked ( ) const
inline
bool em5::FireComponent::isIntact ( ) const
inline

Return if the entity is still intact, i.e. has not burned before.

bool em5::FireComponent::isReadyForCleanup ( ) const

Return true if the component is not on fire and it doesn't plan to start a fire. Must get fire damage one time.

virtual void em5::FireComponent::onComponentPropertyChange ( const qsf::Component component,
uint32  propertyId 
)
overrideprotectedvirtual

Called in case a component property value was changed.

Parameters
[in]componentComponent instance which had a property value change
[in]propertyIdUnique class property ID the component property which values was changed
Note
  • The default implementation is empty
  • The unique class property identifier is generated by "qsf::StringHash" by using the class property name (e.g. qsf::StringHash("Position") generating the hash value 3091144222)

Reimplemented from qsf::Component.

virtual void em5::FireComponent::onSetActive ( bool  active)
overrideprotectedvirtual

Set whether or not the component is considered to be active.

Parameters
[in]active"true" if the component is considered to be active, else "false"
Note
  • The default implementation is empty
  • This method is only called in case there's a real state change
  • This method is also called in case the component is currently not running
See also
  • "qsf::Component::setActive()"

Reimplemented from em5::FireReceiverComponent.

virtual void em5::FireComponent::onSetSimulating ( bool  simulating)
overrideprotectedvirtual

Set whether or not the component is in simulating mode.

Parameters
[in]active"true" if the component is in simulating mode, else "false"
Note
  • The default implementation is empty
  • This method is only called in case there's a real state change
  • In contrast to internal flags (e.g. Active, Debug), the simulating mode state can only be changed globally for a whole map
  • On component shutdown and simulating enabled, "onSetSimulating()" is automatically called with "false" before calling "onShutdown()"

Reimplemented from em5::FireReceiverComponent.

virtual void em5::FireComponent::onShutdown ( )
overrideprotectedvirtual

Shutdown the component.

Note
  • Only called in case "onStartup()" returned successfully
  • The default implementation is empty

Reimplemented from qsf::Component.

virtual bool em5::FireComponent::onStartup ( )
overrideprotectedvirtual

Startup the component.

Returns
"true" if all went fine, else "false"
Note
  • The default implementation is empty
  • Only components which are part of entities (concrete prototype instances) get started
  • When this method gets called, the properties might still be on default values but it's also possible that properties already have customized values. Take this into account when implementing your method.

Reimplemented from qsf::Component.

virtual void em5::FireComponent::receiveFireEnergy ( float  fireEnergy,
const qsf::Time timePassed,
qsf::Component sender 
)
overrideprotectedvirtual

Handle the received energy and gives it to the special receiver.

Parameters
[in]fireEnergyAmount of energy which gets received
[in]timePassedTime passed since last call
[in]senderPointer to the sender of the energy, can be nullptr

Reimplemented from em5::FireReceiverComponent.

virtual void em5::FireComponent::setCountedForExtinguishAchievement ( bool  canCounted)
overridevirtual

Enable or disable counting for the extinguishing fires achievement.

Reimplemented from em5::FireReceiverComponent.

void em5::FireComponent::setEnergy ( float  energy)
inline

Set the energy of the fire.

Parameters
[in]energyThe current energy value
void em5::FireComponent::setEnergyPercent ( float  fraction)
void em5::FireComponent::setExtinguishBlocked ( bool  extinguishBlocked)
inline
void em5::FireComponent::setFireEnergyAndDamageRestrictionPercentage ( float  limitPercentage)

Sets a limit for the fire energy and fire damage (Percentage value -> When limit reached any further extinguishing doesn't have any effect or any additional damage by fire is ignored)

Note
  • Currently this is only needed for the tutorial
void em5::FireComponent::setFireMaterialByName ( const std::string &  fireMaterialName)

Set the name of the fire material asset to use.

Note
  • Connected to the CAMP reflection system
void em5::FireComponent::setFireState ( FireState  fireState)

Set the current fire state. Show or hide the necessary graphics, like particles or building destruction.

Note
This is reflected to camp export
void em5::FireComponent::setFireStateByEvent ( FireState  fireState,
FreeplayEvent freeplayEvent = nullptr 
)

Set fire state by event.

void em5::FireComponent::setHardRadius ( float  hardRadius)
inline

Set the hard fire radius.

Parameters
[in]hardRadiusHard radius from the fire child in meters
void em5::FireComponent::setPlayAudio ( bool  playAudio)
inline

Set if fire sounds are playing for this component.

void em5::FireComponent::setReceivedEnergyFactor ( float  factor)

Set the received energy factor.

void em5::FireComponent::setShowFireRadii ( bool  showFireRadii)

Activate/Deactivate displaying the fire radii (only needed for the editor)

void em5::FireComponent::setSoftRadius ( float  softRadius)
inline

Set the soft fire radius.

Parameters
[in]softRadiusSoft radius from the fire child in meters
void em5::FireComponent::setTotalDamage ( float  damage)
inline

Set the total damage value of the entity, if higher than getLife() of "em5::FireMaterial", entity is destroyed.

Parameters
[in]damageThe total damage to the entity
void em5::FireComponent::showOnExplosionFireParticles ( )

Show the particles which are edited as show on explosion Usually no need to call this manually, but needed by the DamageComonent::onExplosion derivatives.

void em5::FireComponent::startFire ( FreeplayEvent freeplayEvent)

Set the entity on fire. Use this as easy access function, it's also possible to set the fire state directly.

void em5::FireComponent::stopFire ( )

Immediately stops the fire. Use this as easy access function, it's also possible to set the fire state directly.

void em5::FireComponent::triggerExplosion ( )

Immediately destroy the entity, with an explosion if the material is edited with one. Use this as easy access function, it's also possible to set the fire state directly.

void em5::FireComponent::updateParticlesVisibility ( )
inline
virtual void em5::FireComponent::updateSimulation ( const qsf::Time timePassed)
overrideprotectedvirtual

Update the simulation state of this component.

Parameters
[in]timePassedTime passed since last call

Reimplemented from em5::FireReceiverComponent.

Friends And Related Function Documentation

friend class ComplexFireComponent
friend
friend class FireSystem
friend
friend class multiplayer::FireData
friend

Member Data Documentation

const uint32 em5::FireComponent::COMPONENT_ID
static

"em5::FireComponent" unique component ID

const uint32 em5::FireComponent::HARD_RADIUS
static
const uint32 em5::FireComponent::SOFT_RADIUS
static

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