VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtEchelonLogic Class Reference

Detailed Description

The DtEchelonLogic tracks hierarchical relationships between entities in a command structure. It queries the DtElementIDHierarchyState to determine an entity's superior (commanding entity) and its peer subordinates (other entities sharing the same superior), then publishes this information as state attributes for use by other components.

The component maintains the following state attributes:

  • "Superior": The display name of the entity's commanding officer/unit
  • "subordinateList": A list of display names of peer entities (others reporting to the same superior)
  • "taskableEntities": Boolean flag indicating if there are any peer entities to potentially task

#include <echelonLogic.h>

Inheritance diagram for makVre::DtEchelonLogic:
[legend]

Public Member Functions

 DtEchelonLogic ()
 
virtual ~DtEchelonLogic () override
 
virtual bool initialize (DtPlayerStation *player, 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 DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () const
 

Protected Member Functions

virtual void initializeStateAttributes () override
 
virtual makVrv::DtElementID lookupSuperior (makVrv::DtDe &de, makVrv::DtElementID id) const
 
virtual const makVrv::DtElementIDHierarchyState::ElementIDVector lookupSubordinates (makVrv::DtDe &de, makVrv::DtElementID id) const
 
virtual const makVrv::DtElementIDHierarchyStateAttribute * findHierarchyItem (makVrv::DtDe &de, makVrv::DtElementID id) const
 

Additional Inherited Members

- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Constructor & Destructor Documentation

◆ DtEchelonLogic()

makVre::DtEchelonLogic::DtEchelonLogic ( )

Constructor for DtEchelonLogic.

Initializes the component with the name "DtEchelonLogic".

◆ ~DtEchelonLogic()

virtual makVre::DtEchelonLogic::~DtEchelonLogic ( )
overridevirtual

Virtual destructor for DtEchelonLogic.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtEchelonLogic::initialize ( DtPlayerStation * player,
DtInitTable & config )
overridevirtual

Initializes the component with configuration from Lua.

Performs basic initialization using the parent class implementation.

Parameters
playerPointer to the player station this component belongs to
configConfiguration table containing initialization parameters
Returns
True if initialization succeeds, false otherwise

Reimplemented from makVre::DtPlayerComponent.

References makVre::DtPlayerComponent::player().

◆ tick()

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

Updates the component state.

Called each frame to update the command hierarchy information. This method:

  • Looks up the entity's superior/commanding entity
  • Finds all entities subordinate to that superior (peers of this entity)
  • Updates the "Superior", "subordinateList", and "taskableEntities" state attributes
Parameters
dtDelta time in seconds since the last tick

Implements makVre::DtPlayerComponent.

◆ shutdown()

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

Shuts down the component.

Performs cleanup by calling the parent class shutdown method.

Reimplemented from makVre::DtPlayerComponent.

◆ type()

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

Returns the component type identifier.

Returns
The component type string

Implements makVre::DtPlayerComponent.

◆ initializeStateAttributes()

virtual void makVre::DtEchelonLogic::initializeStateAttributes ( )
overrideprotectedvirtual

Initializes state attributes.

This method is reserved for initializing state attributes in the future. Currently, it has an empty implementation with commented-out code.

Reimplemented from makVre::DtPlayerComponent.

◆ lookupSuperior()

virtual makVrv::DtElementID makVre::DtEchelonLogic::lookupSuperior ( makVrv::DtDe & de,
makVrv::DtElementID id ) const
protectedvirtual

Looks up the superior (commanding entity) for a given entity.

Queries the DtElementIDHierarchyState to find the parent entity ID for the specified entity.

Parameters
deReference to the dynamic environment
idElement ID of the entity to find the superior for
Returns
Element ID of the superior entity, or 0 if not found

References de().

◆ lookupSubordinates()

virtual const makVrv::DtElementIDHierarchyState::ElementIDVector makVre::DtEchelonLogic::lookupSubordinates ( makVrv::DtDe & de,
makVrv::DtElementID id ) const
protectedvirtual

Looks up subordinate entities for a given entity.

Queries the DtElementIDHierarchyState to find all child entities for the specified entity.

Parameters
deReference to the dynamic environment
idElement ID of the entity to find subordinates for
Returns
Vector of element IDs of subordinate entities

References de().

◆ findHierarchyItem()

virtual const makVrv::DtElementIDHierarchyStateAttribute * makVre::DtEchelonLogic::findHierarchyItem ( makVrv::DtDe & de,
makVrv::DtElementID id ) const
protectedvirtual

Finds the hierarchy state attribute for a given entity.

Locates the DtElementIDHierarchyStateAttribute for the specified entity by looking it up in the data bank.

Parameters
deReference to the dynamic environment
idElement ID of the entity to find the hierarchy item for
Returns
Pointer to the hierarchy state attribute, or nullptr if not found

References de().


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