|
VR-Engage
2.3
|
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 () |
| bool | componentReady () const |
| void | setComponentReady (bool ready) |
| virtual DtInitTickStatus | finalizeInitTick (double dt) |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
| virtual const DtAttributeHandle & | ownshipState () const |
| virtual void | setExtendedData (const std::string &key, const std::string &value, DtEntityIdentifier entity=DtEntityIdentifier::nullId()) |
Additional Inherited Members | |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| bool | myComponentReady = true |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| DtVreMessageHandlerGroup | myMessageHandlers |
| 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.