Emergency 2017 Dokumentation  v3.0.1
qsf::Component Class Reference

Abstract component class. More...

#include <Component.h>

Public Types

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

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 ()
 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 Attributes

static const uint32 COMPONENT_ID
 "qsf::Component" unique component ID More...
 

Protected Member Functions

 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 implementsOnComponentPropertyChange () const
 Signal whether this component needs the "onComponentPropertyChange" callback at all. More...
 
virtual void onComponentPropertyChange (const Component &component, uint32 propertyId)
 Called in case a component property value was changed. More...
 
virtual void onComponentTransformChange (const Transform &transform, TransformChangeFlags flags)
 Called in case a component transformation value was changed. More...
 
virtual void onSetSimulating (bool simulating)
 Set whether or not the component is in simulating mode. More...
 
virtual void onSetActive (bool active)
 Set whether or not the component is considered to be active. 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...
 
virtual bool onStartup ()
 Startup the component. More...
 
virtual void onShutdown ()
 Shutdown the component. 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 Prototype
 
class Entity
 
class ComponentSystem
 
class ComponentCollection
 
class Map
 

Additional Inherited Members

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

Detailed Description

Abstract component class.

Remarks
Component lifecycle:
  • "onStartup()"
  • "onShutdown()"

In order to access properties of components, one can use directly the C++ headers. Beside this native way which requires access to these C++ headers, it's also possible to use the CAMP reflection system as shown in the following example:

// Component* component = <"qsf::MetadataComponent" instance>
if (nullptr != component)
{
// Set properties
camp::UserObject campUserObject = component;
campUserObject.set("Name", "Alice");
campUserObject.set("Description", "This is the test entity Alice");
// Get property
std::string name = campUserObject.get("Name").to<std::string>();
// ...
}

Optionally, one can also write

// Component* component = <"qsf::MetadataComponent" instance>
if (nullptr != component)
{
// Set properties
component->setPropertyValuesByString("Name=\"Alice\" Description=\"This is the test entity Alice\"");
// Get property
std::string name = camp::UserObject(component).get("Name").to<std::string>();
// ...
}

or also

// Entity* entity = ...
entity->createComponentByIdWithValues("qsf::MetadataComponent", "Name=\"Alice\" Description=\"This is the test entity Alice\"");

in order to set CAMP reflection system properties directly when creating an component instance. In general, by using the CAMP reflection system approach, there's of course a runtime overhead involved. So, don't use this in highly performance critical situations.

Each component class connected to the CAMP reflection system can have the following tags:

  • "CoreComponent": "true" if this component is considered to be a core component, see "qsf::Map::getCoreEntity()" documentation for details, default is "false"
  • "Serializable": Use this to give the system a hint whether or not this component should be serialized (load/save), the default setting is "true"
  • "Hidden": Do not show this component within e.g. the editor
  • "RootClass": Name of the CAMP class which is the root of the class hierarchy used to register/unregister the component, the default setting is "qsf::Component". Do only set another CAMP class if you know what you're doing.
  • See "qsf::ClassSystem"-documentation for more tags
Note
  • Keep the constructor/destructor implementation lightweight and do the heavy work within "onStartup()"/"onShutdown()"
  • Only components which are part of entities (concrete prototype instances) get started

Definition at line 105 of file Component.h.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
TRANSFORM_CHANGE_POSITION 

Position has changed.

TRANSFORM_CHANGE_ROTATION 

Rotation has changed.

TRANSFORM_CHANGE_SCALE 

Scale has changed.

TRANSFORM_CHANGE_TRANSFORM 

Whole transformation has changed (position, rotation and scale)

TRANSFORM_CHANGE_FOR_SIMULATION 

The simulation transformation was changed.

TRANSFORM_CHANGE_FOR_ANIMATION 

The animation transformation was changed.

Definition at line 125 of file Component.h.

Constructor & Destructor Documentation

qsf::Component::~Component ( )
inlinevirtual

Destructor.

Note
  • Do never destroy a component manually, use "qsf::Prototype::destroyComponentById()" instead

Definition at line 20 of file Component-inl.h.

qsf::Component::Component ( Prototype prototype)
explicitprotected

Constructor.

Parameters
[in]prototypeThe prototype this component is in, no null pointer allowed (the CAMP reflection system does not like references in constructors, so we have to use a pointer instead)
Note
  • Use "qsf::Prototype::createComponentById()" to create a prototype component instance

Member Function Documentation

template<typename T , typename S >
bool qsf::Component::assignAndPromoteChange ( T &  variable,
const S &  newValue,
uint32  propertyId 
)
protected

Comfort function for updating an exported member variable and promoting any change that happened.

Returns
"true" the value actually changed, "false" if the same value was already set
Remarks
If variable is equal to newValue, nothing happens. Otherwise variable is assigned newValue and a property change for propertyId is promoted.

Definition at line 135 of file Component-inl.h.

ComponentCollection& qsf::Component::getComponentCollection ( ) const

Return the component collection that's responsible for this component instance.

Returns
The component collection; do not destroy the returned instance
Remarks
Do not call this for prototype components, for only entity components can be registered within a component collection
ComponentManager& qsf::Component::getComponentManager ( ) const

Return the component manager that's responsible for this component instance.

Returns
The component manager; do not destroy the returned instance
Entity& qsf::Component::getEntity ( ) const

Return a reference to the entity this component is in.

Returns
The entity this component is in, do no destroy the returned instance
Note
  • An entity is a concrete prototype instance
  • Do only use this method if you know exactly that this component is started and therefore is part of an entity, there's no internal security check!
uint64 qsf::Component::getEntityId ( ) const

Return the ID of the entity this component is in.

Returns
The ID of the entity this component is in
Note
  • An entity is a concrete prototype instance
  • Do only use this method if you know exactly that this component is started and therefore is part of an entity, there's no internal security check!
  • A shortcut for "getEntity().getId()" that avoids including the entity header just for using its ID
uint32 qsf::Component::getId ( ) const
inline

Return the unique component identifier.

Returns
The unique component identifier
Note
  • The unique component identifier is generated by "qsf::StringHash" by using the class name (e.g. qsf::StringHash("qsf::MetadataComponent") generating the hash value 483975945)
  • Connected to the CAMP reflection system

Definition at line 32 of file Component-inl.h.

virtual const Object* qsf::Component::getPropertyDefaultsProvider ( ) const
overrideprotectedvirtual

Reimplemented from qsf::InheritedObject.

Prototype & qsf::Component::getPrototype ( ) const
inline

Return the prototype this component is in.

Returns
The prototype this component is in, do no destroy the returned instance

Definition at line 25 of file Component-inl.h.

uint64 qsf::Component::getPrototypeId ( ) const

Return the ID of the prototype this component is in.

Returns
The ID of the prototype this component is in
Note
  • A shortcut for "getPrototype().getId()" that avoids including the prototype header just for using its ID
bool qsf::Component::implementsOnComponentPropertyChange ( ) const
inlineprotectedvirtual

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 in qsf::LinkComponent, em5::FireComponent, qsf::MeshAnimationComponent, qsf::MeshComponent, qsf::AudioComponent, qsf::StreetSectionComponent, qsf::compositing::DefaultCompositingComponent, qsf::LightAnimationComponent, qsf::PhysicsRigidBodyComponent, qsf::NodesComponent, qsf::editor::GizmoComponent, qsf::RendererComponent, em5::SupervisorCompositingComponent, qsf::DebugTextComponent, qsf::ai::NavigationComponent, em5::ContaminationCloudComponent, qsf::DecalGeometricComponent, qsf::SpatialPartitionMemberComponent, qsf::StreetCrossingComponent, em5::InjurePersonAreaComponent, qsf::LinearRotationComponent, qsf::BulletCollisionComponent, qsf::MapRendererComponent, qsf::game::BoneToBoneLinkComponent, qsf::game::BoneLinkComponent, qsf::AmbientPolygonComponent, qsf::TraceDecalComponent, qsf::game::GroundMarkerComponent, qsf::AudioPlaybackManagementComponent, qsf::game::SnowComponent, qsf::GroundTypePolygonComponent, qsf::LiquidPolygonComponent, qsf::DecalProjectedComponent, qsf::PhysicsGroundMapComponent, qsf::BoostSignalComponent, em5::WaterDeepTypePolygonComponent, em5::GhostComponent, qsf::DecalGeometricReceiverComponent, qsf::ai::RouterComponent, qsf::PhysicsTerrainComponent, qsf::AudioListenerComponent, qsf::ai::CloseEntitiesTrackingComponent, and qsf::ai::SimpleBarrierComponent.

Definition at line 85 of file Component-inl.h.

bool qsf::Component::isActive ( ) const
inline

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

Returns
"true" if the component is considered to be active, else "false"
Note
  • By default, components are considered to be active
  • Not connected to the CAMP reflection system by intent, this only makes sense for concrete components

Definition at line 42 of file Component-inl.h.

bool qsf::Component::isDebug ( ) const
inline

Return whether or not the component is considered to be in debug mode.

Returns
"true" if the component is considered to be in debug mode, else "false"
Note
  • Not connected to the CAMP reflection system by intent, this should be internal only

Definition at line 47 of file Component-inl.h.

bool qsf::Component::isGloballyHidden ( ) const
inline

Return whether or not the component is globally hidden.

Returns
"true" if the component is globally hidden, else "false"
Remarks
While a component is not hidden itself, it might be hidden as an end result because the layer the owner entity of the component is in is hidden.
Note
  • Not connected to the CAMP reflection system by intent, this must be internal only

Definition at line 57 of file Component-inl.h.

bool qsf::Component::isHidden ( ) const
inline

Return whether or not the component is hidden.

Returns
"true" if the component is hidden, else "false"
Remarks
"Hidden" is a passive special component feature. While the content of hidden components is identical to the content of not hidden components, the content of hidden components will not be visible inside the render viewport. This special property will not be serialized and e.g. inside the QSF editor will have no influence on the component hidden state of other QSF editor users.
Note
  • Not connected to the CAMP reflection system by intent, this must be internal only

Definition at line 52 of file Component-inl.h.

bool qsf::Component::isReallyHidden ( ) const
inline

Return whether or not the component is really hidden.

Returns
"true" if the component is really hidden, else "false"
Remarks
While a component is not hidden itself, it might be hidden as an end result because the layer the owner entity of the component is in is hidden. This method returns the final hidden state after taking everything into account.
Note
  • Not connected to the CAMP reflection system by intent, this must be internal only

Definition at line 62 of file Component-inl.h.

bool qsf::Component::isRunning ( ) const
inline

Return whether or not the component is up-and-running.

Returns
"true" if the component is up-and-running ("onStartup()" was called successfully), else "false"

Definition at line 67 of file Component-inl.h.

bool qsf::Component::isSimulating ( ) const
inline

Return whether or not the component is in simulating mode.

Returns
"true" if the component is in simulating mode, else "false"
Note
  • This is an ease-of-use method that returns the associated map's simulating mode state
  • In case there is no map, i.e. for prototype components, this will always return "false"

Definition at line 37 of file Component-inl.h.

void qsf::Component::onComponentPropertyChange ( const Component component,
uint32  propertyId 
)
inlineprotectedvirtual

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 in qsf::LinkComponent, em5::FireComponent, qsf::MeshAnimationComponent, qsf::MeshComponent, qsf::StreetSectionComponent, qsf::TerrainComponent, qsf::compositing::DefaultCompositingComponent, qsf::LightAnimationComponent, qsf::PhysicsRigidBodyComponent, qsf::NodesComponent, qsf::DebugTextComponent, qsf::ai::NavigationComponent, qsf::CameraAnimationComponent, qsf::ai::SensorComponent, qsf::DecalGeometricComponent, qsf::StreetCrossingComponent, qsf::LinearRotationComponent, qsf::BulletCollisionComponent, qsf::editor::MovementGizmoComponent, qsf::MapRendererComponent, qsf::game::BoneToBoneLinkComponent, qsf::game::BoneLinkComponent, qsf::AmbientPolygonComponent, qsf::TraceDecalComponent, qsf::game::SnowComponent, qsf::GroundTypePolygonComponent, qsf::LiquidPolygonComponent, qsf::DecalProjectedComponent, qsf::PhysicsGroundMapComponent, qsf::BoostSignalComponent, em5::WaterDeepTypePolygonComponent, qsf::DecalGeometricReceiverComponent, qsf::PhysicsTerrainComponent, and qsf::ai::SimpleBarrierComponent.

Definition at line 91 of file Component-inl.h.

void qsf::Component::onComponentTransformChange ( const Transform transform,
TransformChangeFlags  flags 
)
inlineprotectedvirtual

Called in case a component transformation value was changed.

Parameters
[in]transformThe changed transformation
[in]flagsFlags describing the change
Note
  • The default implementation is empty
  • In order for this to get called at all in simulating mode, an entity has to register itself as listener for simulation and/or animation transform changes, see e.g. "qsf::Component::setRegisterForSimulationTransformChanges".

Reimplemented in qsf::LightComponent, qsf::LinkComponent, qsf::CameraComponent, qsf::ParticlesComponent, qsf::AudioComponent, qsf::PhysicsRigidBodyComponent, qsf::SunComponent, qsf::editor::GizmoComponent, qsf::RendererComponent, em5::FireReceiverComponent, qsf::SpatialPartitionMemberComponent, qsf::PolygonComponent, qsf::MeterBoxComponent, qsf::BulletCollisionComponent, qsf::game::GroundMarkerComponent, qsf::AudioPlaybackManagementComponent, qsf::ai::RouterComponent, qsf::BulletBoxCollisionComponent, qsf::AudioListenerComponent, and qsf::ai::CloseEntitiesTrackingComponent.

Definition at line 96 of file Component-inl.h.

void qsf::Component::onInvalidation ( )
inlinevirtual

Invalidate the component.

Note
  • Called after the component was removed from its prototype, but is not yet destroyed

Reimplemented in qsf::LinkComponent.

Definition at line 76 of file Component-inl.h.

void qsf::Component::onSetActive ( bool  active)
inlineprotectedvirtual

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 in em5::FireComponent, qsf::ParticlesComponent, qsf::MovableComponent, qsf::AudioComponent, qsf::LightAnimationComponent, qsf::PhysicsRigidBodyComponent, qsf::MeshAnimationTestComponent, qsf::RendererComponent, em5::ComplexFireComponent, qsf::PhysicsWorldComponent, em5::LightTimeControlComponent, em5::FireReceiverComponent, qsf::game::TimeOfDayComponent, qsf::game::WeatherComponent, qsf::GameLogicComponent, qsf::DebugTextComponent, qsf::game::PlayAnimationComponent, qsf::game::CharacterAnimationComponent, qsf::AmbientAudioManagementComponent, em5::ParticleTimeControlComponent, qsf::CameraAnimationComponent, qsf::ScriptComponent, qsf::game::LightControllerComponent, qsf::ActiveToggleComponent, qsf::DynamicMusicCompositorComponent, em5::HydrantComponent, em5::SimpleBarrierTapeComponent, qsf::MarkerComponent, em5::InjurePersonAreaComponent, qsf::LinearRotationComponent, em5::BloodPuddleComponent, qsf::BulletCollisionComponent, em5::SwingComponent, qsf::logic::PlaySequenceComponent, em5::HighlightComponent, qsf::game::RandomMovementComponent, qsf::editor::GridComponent, em5::AudioComponent, qsf::game::GroundMarkerComponent, qsf::LookAtComponent, em5::PathMovementComponent, qsf::CameraTextureRenderComponent, em5::MoveToDespawnComponent, qsf::game::SnowComponent, em5::GroundSpotComponent, qsf::game::MaterialAccessComponent, qsf::CustomBoundingBoxComponent, qsf::ai::PathfindingSystem, em5::FireDroneScanComponent, qsf::LiquidPolygonComponent, qsf::SkyComponent, em5::StakeComponent, qsf::ai::RouterComponent, qsf::LookIntoMovementDirectionComponent, em5::HistoricWellComponent, qsf::DebugBulletBoxCollisionSensorComponent, qsf::AudioListenerComponent, em5::SekDroneScanComponent, qsf::RecursiveActiveFlagComponent, qsf::ai::TrafficLightTimerComponent, qsf::ai::DynamicCollisionLocalPlanner, and qsf::ai::SystemComponent.

Definition at line 106 of file Component-inl.h.

void qsf::Component::onSetDebug ( bool  debug)
inlineprotectedvirtual

Set whether or not the component is considered to be in debug mode.

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

Reimplemented in qsf::LightComponent, qsf::LinkComponent, qsf::MeshComponent, qsf::MapPropertiesComponent, qsf::PhysicsRigidBodyComponent, qsf::NodesComponent, qsf::RendererComponent, qsf::PhysicsWorldComponent, qsf::game::TimeOfDayComponent, qsf::GameLogicComponent, em5::ContaminationCloudComponent, qsf::ai::SensorComponent, em5::WaterjetComponent, em5::ContaminationComponent, em5::InjurePersonAreaComponent, qsf::BulletCollisionComponent, qsf::MapRendererComponent, qsf::ai::SteeringSystem, qsf::ai::PathfindingSystem, and em5::IndustrialPlantComponent.

Definition at line 111 of file Component-inl.h.

void qsf::Component::onSetHidden ( bool  hidden)
inlineprotectedvirtual

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

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

Reimplemented in qsf::compositing::DefaultCompositingComponent, qsf::editor::GizmoComponent, qsf::RendererComponent, and qsf::LiquidPolygonComponent.

Definition at line 116 of file Component-inl.h.

void qsf::Component::onSetSimulating ( bool  simulating)
inlineprotectedvirtual

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 in qsf::LightComponent, qsf::LinkComponent, qsf::CameraComponent, em5::FireComponent, qsf::ParticlesComponent, qsf::MovableComponent, qsf::AudioComponent, em5::HealthComponent, qsf::MeshComponent, em5::BuildingComponent, em5::VehicleComponent, qsf::LightAnimationComponent, qsf::PhysicsRigidBodyComponent, qsf::ActionComponent, qsf::RendererComponent, em5::ComplexFireComponent, em5::PersonComponent, qsf::PhysicsWorldComponent, em5::LightTimeControlComponent, em5::FireReceiverComponent, qsf::game::TimeOfDayComponent, qsf::game::WeatherComponent, qsf::GameLogicComponent, qsf::ai::NavigationComponent, qsf::game::CharacterAnimationComponent, em5::HelicopterComponent, em5::ContaminationCloudComponent, em5::ParticleTimeControlComponent, em5::DamageComponent, em5::RoadVehicleComponent, em5::TreeComponent, qsf::SpatialPartitionMemberComponent, em5::SimpleBarrierTapeComponent, em5::OverlayComponent, em5::InjurePersonAreaComponent, em5::SimpleFireHoseComponent, qsf::BulletCollisionComponent, em5::PersonPlacementComponent, qsf::game::HiddenComponent, em5::ActivityComponent, qsf::game::InventoryComponent, qsf::logic::PlaySequenceComponent, em5::PersonMagnetComponent, qsf::game::RandomMovementComponent, qsf::game::GroundMarkerComponent, qsf::compositing::HighlightComponent, em5::PathMovementComponent, em5::UnitSpawnPointComponent, qsf::AudioPlaybackManagementComponent, em5::MoveToDespawnComponent, qsf::game::TrafficLightComponent, em5::GroundSpotComponent, em5::BuryComponent, qsf::BulletTriangleMeshCollisionComponent, qsf::ai::SteeringSystem, em5::WaterCannonComponent, em5::InhabitantComponent, em5::CommandTargetComponent, em5::InjuryAtStartupComponent, em5::FireDroneScanComponent, em5::HelicopterSearchLightComponent, qsf::ai::WorldModelManager, qsf::game::VehicleComponent, em5::StakeComponent, em5::LightControlComponent, em5::UpgradeComponent, em5::GaperComponent, qsf::ai::RouterComponent, em5::SpeakToPersonComponent, qsf::PhysicsTerrainComponent, em5::HistoricWellComponent, qsf::DebugBulletBoxCollisionSensorComponent, em5::CallForRescueComponent, qsf::AudioListenerComponent, qsf::ai::TrafficLightTimerComponent, em5::BlockedForEventComponent, em5::PoliceDogTargetComponent, qsf::ai::CloseEntitiesTrackingComponent, qsf::ai::ReservationSystem, and qsf::ai::NavigationTaskThread.

Definition at line 101 of file Component-inl.h.

void qsf::Component::onShutdown ( )
inlineprotectedvirtual

Shutdown the component.

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

Reimplemented in qsf::LightComponent, qsf::LinkComponent, qsf::CameraComponent, em5::FireComponent, qsf::AdvancedAnimationComponent, qsf::ParticlesComponent, qsf::MeshAnimationComponent, qsf::MovableComponent, qsf::AudioComponent, qsf::MeshComponent, em5::HealthComponent, em5::VehicleComponent, qsf::StreetSectionComponent, qsf::TerrainComponent, qsf::compositing::DefaultCompositingComponent, qsf::LightAnimationComponent, qsf::AmbientSpotAudioMergingComponent, em5::VehicleCraneComponent, qsf::FlareComponent, qsf::PathMeshComponent, qsf::PhysicsRigidBodyComponent, qsf::SunComponent, qsf::editor::GizmoComponent, qsf::MeshAnimationTestComponent, qsf::PhysicsWorldComponent, qsf::ActionComponent, em5::PersonComponent, em5::EventIdComponent, em5::BarrierTapeComponent, qsf::game::TimeOfDayComponent, qsf::game::WeatherComponent, qsf::DebugTextComponent, qsf::GameLogicComponent, qsf::ai::NavigationComponent, qsf::compositing::TintableMeshComponent, qsf::AmbientAudioManagementComponent, em5::DoorComponent, qsf::CameraFlightComponent, em5::HelicopterComponent, em5::ContaminationCloudComponent, qsf::CameraAnimationComponent, qsf::ScriptComponent, em5::DamageComponent, qsf::game::LightControllerComponent, qsf::ActiveToggleComponent, em5::RoadVehicleComponent, em5::WaterjetComponent, qsf::DecalGeometricComponent, qsf::DynamicMusicCompositorComponent, qsf::game::EventTagComponent, qsf::SpatialPartitionMemberComponent, qsf::MarkerComponent, qsf::LinearRotationComponent, em5::SimpleBarrierTapeComponent, qsf::game::EventTagManagerComponent, em5::SwingComponent, em5::InjurePersonAreaComponent, em5::BloodPuddleComponent, em5::SimpleFireHoseComponent, qsf::SpatialPartitionManagerComponent, qsf::BulletCollisionComponent, qsf::game::CommandableComponent, qsf::MeterBoxComponent, em5::ActivityComponent, em5::HistoricPlagueBuildingComponent, qsf::AmbientPolygonComponent, qsf::game::InventoryComponent, qsf::editor::GridComponent, qsf::logic::PlaySequenceComponent, em5::PersonMagnetComponent, em5::HighlightComponent, qsf::TraceDecalComponent, em5::AudioComponent, em5::RescueBusComponent, qsf::game::BoneLinkComponent, qsf::game::RandomMovementComponent, qsf::AudioPlaybackManagementComponent, qsf::LookAtComponent, qsf::CameraTextureRenderComponent, qsf::compositing::HighlightComponent, qsf::game::GroundMarkerComponent, qsf::game::SnowComponent, em5::SpeedLimitComponent, em5::EboxComponent, qsf::game::MaterialAccessComponent, qsf::DecalProjectedComponent, qsf::CustomBoundingBoxComponent, qsf::MeterRulerComponent, em5::GroundSpotComponent, qsf::GameLogicSystem, qsf::ai::SteeringSystem, em5::CommandTargetComponent, qsf::PhysicsGroundMapComponent, qsf::ai::PathfindingSystem, em5::FireDroneScanComponent, qsf::SkyComponent, em5::FadeEffectComponent, qsf::LiquidPolygonComponent, qsf::ai::WorldModelManager, qsf::compositing::SkinnableMeshComponent, qsf::game::VehicleComponent, qsf::LookIntoMovementDirectionComponent, qsf::PhysicsTerrainComponent, qsf::ai::StuckResolverComponent, em5::GhostComponent, em5::CallForRescueComponent, qsf::DebugBulletBoxCollisionSensorComponent, em5::SekDroneScanComponent, em5::BlockedForEventComponent, qsf::ai::CloseEntitiesTrackingComponent, qsf::ai::DynamicCollisionLocalPlanner, qsf::ai::NavigationElementConnector, qsf::ai::DynamicCollisionConverterComponent, qsf::ai::SystemComponent, and qsf::ai::NavigationTaskThread.

Definition at line 129 of file Component-inl.h.

bool qsf::Component::onStartup ( )
inlineprotectedvirtual

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 in qsf::LightComponent, qsf::LinkComponent, qsf::CameraComponent, em5::FireComponent, qsf::AdvancedAnimationComponent, qsf::ParticlesComponent, qsf::MovableComponent, qsf::AudioComponent, qsf::MeshComponent, em5::HealthComponent, em5::BuildingComponent, em5::VehicleComponent, qsf::StreetSectionComponent, qsf::TerrainComponent, qsf::compositing::DefaultCompositingComponent, qsf::LightAnimationComponent, qsf::AmbientSpotAudioMergingComponent, qsf::PlaySkeletalAnimationComponent, qsf::FlareComponent, qsf::PathMeshComponent, qsf::PhysicsRigidBodyComponent, qsf::SunComponent, qsf::editor::GizmoComponent, qsf::MeshAnimationTestComponent, qsf::PhysicsWorldComponent, qsf::ActionComponent, em5::PersonComponent, em5::EventIdComponent, em5::LightTimeControlComponent, qsf::game::TimeOfDayComponent, qsf::game::WeatherComponent, qsf::AnnotationComponent, qsf::game::PlayAnimationComponent, qsf::DebugTextComponent, qsf::GameLogicComponent, qsf::ai::NavigationComponent, em5::BuildingLightTimeControlComponent, qsf::compositing::TintableMeshComponent, qsf::game::CharacterAnimationComponent, qsf::AmbientAudioManagementComponent, qsf::PlayCharacterAnimationComponent, em5::DoorComponent, qsf::CameraFlightComponent, em5::ContaminationCloudComponent, qsf::CameraAnimationComponent, em5::ParticleTimeControlComponent, qsf::ScriptComponent, em5::DamageComponent, qsf::game::LightControllerComponent, qsf::ActiveToggleComponent, em5::RoadVehicleComponent, em5::WaterjetComponent, qsf::DecalGeometricComponent, qsf::PolygonComponent, qsf::DynamicMusicCompositorComponent, qsf::game::EventTagComponent, qsf::SpatialPartitionMemberComponent, qsf::MarkerComponent, qsf::LinearRotationComponent, qsf::AdvancedAnimationTestComponent, em5::SimpleBarrierTapeComponent, em5::BoatComponent, em5::SwingComponent, em5::InjurePersonAreaComponent, em5::BloodPuddleComponent, qsf::SpatialPartitionManagerComponent, em5::SimpleFireHoseComponent, qsf::MapRendererComponent, qsf::game::CommandableComponent, qsf::MeterBoxComponent, qsf::ai::ReactionComponent, em5::ActivityComponent, em5::HistoricPlagueBuildingComponent, qsf::AmbientPolygonComponent, qsf::game::InventoryComponent, qsf::editor::GridComponent, em5::HighlightComponent, qsf::TraceDecalComponent, em5::AudioComponent, qsf::game::BoneLinkComponent, qsf::game::RandomMovementComponent, qsf::AudioPlaybackManagementComponent, qsf::LookAtComponent, qsf::CameraTextureRenderComponent, qsf::game::GroundMarkerComponent, em5::HedgeComponent, qsf::GroundTypePolygonComponent, qsf::game::SnowComponent, em5::SpeedLimitComponent, em5::EboxComponent, qsf::game::MaterialAccessComponent, qsf::PhysicsComponent, qsf::DecalProjectedComponent, qsf::CustomBoundingBoxComponent, qsf::MeterRulerComponent, qsf::GameLogicSystem, qsf::ai::SteeringSystem, qsf::PathComponent, qsf::ai::PathfindingSystem, qsf::SkyComponent, em5::ObjectDamageComponent, qsf::LiquidPolygonComponent, qsf::ai::WorldModelManager, qsf::AudioListenerComponent, qsf::DebugBoxComponent, qsf::compositing::HeatCompositingComponent, qsf::game::VehicleComponent, qsf::BulletBoxCollisionComponent, em5::WaterDeepTypePolygonComponent, qsf::LookIntoMovementDirectionComponent, qsf::ai::StuckResolverComponent, em5::DynamicCollisionConverterComponent, qsf::game::LightingComponent, em5::GhostComponent, em5::CivilShipComponent, qsf::DebugBulletBoxCollisionSensorComponent, qsf::ai::ReactionSystem, qsf::ai::SensorPerceptionSystem, em5::SekDroneScanComponent, qsf::ai::TrafficLightTimerComponent, qsf::DebugMeshComponent, qsf::ai::AspectComponent, qsf::ai::DynamicCollisionLocalPlanner, qsf::ai::DynamicCollisionConverterComponent, qsf::ai::SystemComponent, qsf::ai::SimpleBarrierComponent, qsf::ai::NavigationTaskThread, qsf::ai::AiLodSystem, and qsf::ai::StuckResolvingSystem.

Definition at line 121 of file Component-inl.h.

void qsf::Component::promotePropertyChange ( uint32  propertyId)
protected

A component property value was changed.

Parameters
[in]propertyIdUnique class property ID the component property which values was changed
Note
  • 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)
virtual void qsf::Component::serialize ( BinarySerializer serializer)
virtual

Serialize or deserialize the component using a binary serializer.

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

Reimplemented in qsf::LinkComponent, qsf::MovableComponent, em5::HealthComponent, em5::BuildingComponent, em5::VehicleComponent, qsf::MetadataComponent, qsf::LightAnimationComponent, em5::CommandableComponent, qsf::StreetSectionComponent, em5::VehicleCraneComponent, qsf::PathMeshComponent, qsf::NodesComponent, qsf::ActionComponent, em5::LightTimeControlComponent, em5::PersonComponent, em5::EventIdComponent, em5::BarrierTapeComponent, qsf::game::TimeOfDayComponent, qsf::AnnotationComponent, qsf::game::WeatherComponent, qsf::TransformComponent, qsf::ai::NavigationComponent, em5::BuildingLightTimeControlComponent, qsf::CameraAnimationComponent, em5::DoorComponent, qsf::game::CharacterAnimationComponent, em5::DlkLadderComponent, em5::ParticleTimeControlComponent, em5::HelicopterComponent, em5::ContaminationCloudComponent, em5::DamageComponent, qsf::ActiveToggleComponent, em5::HelicopterRotorComponent, em5::RoadVehicleComponent, em5::TreeComponent, qsf::game::EventTagComponent, em5::HelicopterHatchComponent, em5::WaterjetComponent, em5::ContaminationComponent, qsf::PolygonComponent, qsf::StreetComponent, em5::BoatComponent, em5::SpawnPointComponent, em5::SimpleBarrierTapeComponent, qsf::BulletCollisionComponent, qsf::StreetCrossingComponent, qsf::LinearRotationComponent, qsf::compositing::MaterialLightAnimationComponent, em5::InjurePersonAreaComponent, em5::BombComponent, em5::HistoricPlagueBuildingComponent, em5::BloodPuddleComponent, qsf::game::EquipmentComponent, em5::WeatherComponent, em5::SimpleFireHoseComponent, em5::UsableByEngineerComponent, qsf::CameraTextureRenderComponent, qsf::game::CommandableComponent, em5::ActivityComponent, qsf::game::InventoryComponent, em5::HedgeComponent, em5::SupportLegsComponent, em5::AudioComponent, em5::EboxComponent, qsf::LookAtComponent, qsf::ai::SteeringSystem, em5::WheelComponent, em5::SimpleDamageComponent, qsf::ai::PathfindingSystem, em5::BoatDropPointComponent, qsf::game::TrafficLightComponent, em5::BuryComponent, em5::DivingSpotComponent, em5::PersonSpawnPointComponent, em5::WaterCannonComponent, em5::VehicleSpawnPointComponent, em5::UnitSpawnPointComponent, em5::HelicopterSearchLightComponent, qsf::GameLogicSystem, em5::ObjectDamageComponent, em5::InjuryAtStartupComponent, qsf::ai::WorldModelManager, em5::AiLevelOfDetailComponent, qsf::game::PersonComponent, qsf::ai::SensorComponent, em5::IndustrialPlantComponent, em5::SpawnGroupComponent, em5::CallForRescueComponent, qsf::ai::MultipleSensorsComponent, em5::CivilShipComponent, qsf::game::VehicleComponent, em5::UpgradeComponent, em5::GaperComponent, qsf::LookIntoMovementDirectionComponent, qsf::ai::SingleSensorComponent, em5::BlockedForEventComponent, qsf::ai::AspectComponent, qsf::BridgeComponent, em5::GhostComponent, em5::InhabitantComponent, qsf::ai::ReactionComponent, em5::InhabitantSpawnComponent, qsf::ai::NavigationElementConnector, qsf::ai::ReservationSystem, qsf::ai::TrafficLightTimerComponent, qsf::ai::SimpleBarrierComponent, qsf::ai::AiLodComponent, qsf::ai::NavigationTaskThread, and qsf::ai::TrafficLightComponent.

void qsf::Component::setActive ( bool  active)

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"
Remarks
The semantic of "active" depends of the component. An implementation is free to ignore the request or do nothing at all because an active state makes no sense for the component. A render component might for example interpret "active" as "invisible" while an input component might interpret "active" as "deactivate input".
Note
  • Not connected to the CAMP reflection system by intent, this only makes sense for concrete components
virtual void qsf::Component::setDebug ( bool  debugMode)
virtual

Set whether or not the component is considered to be in debug mode.

Parameters
[in]debugMode"true" if the component is considered to be in debug mode, else "false"
Remarks
The semantic of "debug mode" depends of the component. An implementation is free to ignore the request or do nothing at all because a debug mode state makes no sense for the component. A polygon component might for example interpret "debug mode" as "render the polygons" while an input component might interpret "debug mode" as "draw some texts".
Note
  • Not connected to the CAMP reflection system by intent, this should be internal only

Reimplemented in qsf::PolygonComponent, and qsf::PathComponent.

void qsf::Component::setGloballyHidden ( bool  globallyHidden)

Set whether or not the component is globally hidden.

Parameters
[in]globallyHidden"true" if the component is globally hidden, else "false"
See also
  • "qsf::Component::isGloballyHidden()"
Note
  • This method is usually only used by layers
void qsf::Component::setHidden ( bool  hidden)

Set whether or not the component is hidden.

Parameters
[in]hidden"true" if the component is hidden, else "false"
See also
  • "qsf::Component::isHidden()"
void qsf::Component::setRegisterForAnimationTransformChanges ( bool  enable)
protected

Register or unregister this component as animation transform listener.

Parameters
[in]enableIf "true", register, otherwise unregister
Note
  • As this registration is only necessary in simulation mode, best call it inside "onSetSimulating"
void qsf::Component::setRegisterForSimulationTransformChanges ( bool  enable)
protected

Register or unregister this component as simulation transform listener.

Parameters
[in]enableIf "true", register, otherwise unregister
Note
  • As this registration is only necessary in simulation mode, best call it inside "onSetSimulating"
void qsf::Component::shutdown ( )

Shutdown the component.

bool qsf::Component::startup ( )

Startup the component.

Returns
"true" if all went fine, else "false"
Note
  • Only components which are part of entities (concrete prototype instances) get started

Friends And Related Function Documentation

friend class ComponentCollection
friend

Definition at line 115 of file Component.h.

friend class ComponentSystem
friend

Definition at line 114 of file Component.h.

friend class Entity
friend

Definition at line 113 of file Component.h.

friend class Map
friend

Definition at line 116 of file Component.h.

friend class Prototype
friend

Definition at line 112 of file Component.h.

Member Data Documentation

const uint32 qsf::Component::COMPONENT_ID
static

"qsf::Component" unique component ID

Definition at line 123 of file Component.h.


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