VR-Engage  2.3
Loading...
Searching...
No Matches
makVre::DtExtendedStateLogic Class Reference

Detailed Description

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>

Inheritance diagram for makVre::DtExtendedStateLogic:
[legend]

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
 

Constructor & Destructor Documentation

◆ DtExtendedStateLogic()

makVre::DtExtendedStateLogic::DtExtendedStateLogic ( )

Constructor for DtExtendedStateLogic.

Initializes the component with the name "DtExtendedStateLogic".

◆ ~DtExtendedStateLogic()

virtual makVre::DtExtendedStateLogic::~DtExtendedStateLogic ( )
overridevirtual

Virtual destructor for DtExtendedStateLogic.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtExtendedStateLogic::initialize ( makVre::DtPlayerStation * player,
makVre::DtInitTable & config )
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:

  • Add the attribute to the player's attribute store
  • Send an ExtendedStateMonitorInitMessage to register the attribute with the system
Parameters
playerPointer to the player station this component belongs to
configConfiguration table containing attribute definitions
Returns
True if initialization succeeds, false otherwise

Reimplemented from makVre::DtPlayerComponent.

References makVre::DtPlayerComponent::player().

◆ tick()

virtual void makVre::DtExtendedStateLogic::tick ( double dt)
overridevirtual

Updates the component state (empty implementation)

This method is called each frame but currently has no implementation.

Parameters
dtDelta time in seconds since the last tick

Implements makVre::DtPlayerComponent.

◆ shutdown()

virtual void makVre::DtExtendedStateLogic::shutdown ( )
overridevirtual

Shuts down the component.

Sends an ExtendedStateMonitorInitMessage with a null entity ID to deregister the extended state attributes.

Reimplemented from makVre::DtPlayerComponent.

◆ type()

virtual const char * makVre::DtExtendedStateLogic::type ( ) const
overridevirtual

Returns the type identifier for this component.

Returns
The type string for DtExtendedStateLogic

Implements makVre::DtPlayerComponent.


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