|
VR-Engage
2.2
|
The DtExtendedStateLogic component provides functionality to dynamically add custom state attributes to an entity. These attributes can be configured in Lua and support various data types (int, float, double, string, bool, ammoClipMap).
This component is particularly useful for simulation monitoring and sharing state information that isn't covered by the standard state attributes. It will send an ExtendedStateMonitorInitMessage to notify the system of these additional attributes.
#include <extendedStateLogic.h>
Public Member Functions | |
| DtExtendedStateLogic () | |
| virtual | ~DtExtendedStateLogic () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual bool | postInitialize () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Member Functions | |
| void | addAdditionalAttributesToState (std::vector< std::string > &names, std::vector< std::string > &types) |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Additional Inherited Members | |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtExtendedStateLogic::DtExtendedStateLogic | ( | ) |
Constructor for DtExtendedStateLogic.
Initializes the component with the name "DtExtendedStateLogic".
|
overridevirtual |
Virtual destructor for DtExtendedStateLogic.
|
overridevirtual |
Initializes the component with configuration from Lua.
Processes the "extendedState" and "stateProperties" sections from the configuration, creating state attributes based on their specifications. For each attribute defined, the component will:
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing attribute definitions |
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Updates the component state (empty implementation)
This method is called each frame but currently has no implementation.
| dt | Delta time in seconds since the last tick |
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Shuts down the component.
Sends an ExtendedStateMonitorInitMessage with a null entity ID to deregister the extended state attributes.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the type identifier for this component.
Implements makVre::DtPlayerComponent.
|
protected |
Adds custom attributes to the player's attribute store.
Creates attributes in the player's attribute store based on the provided names and types. Supports the following data types:
| names | Vector of attribute names to add |
| types | Vector of attribute types corresponding to the names |