|
VR-Engage
2.2
|
The DtFriendlyUnitsLogic listens for EntityFriendlyUnitsMessages and maintains a list of friendly units via state attributes. When a message is received, the component updates the "subordinateList" and "taskableEntities" state attributes with the list of friendly units and a flag indicating whether any are available, respectively.
This component is particularly useful in command roles where it's important to know what friendly units can be tasked or interacted with.
#include <friendlyUnitLogic.h>
Public Member Functions | |
| DtFriendlyUnitsLogic () | |
| virtual | ~DtFriendlyUnitsLogic () override |
| virtual bool | initialize (DtPlayerStation *player, DtInitTable &config) override |
| virtual bool | postInitialize () 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 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 | |
| virtual void | initializeStateAttributes () override |
| DtVreMessageResult | handleFriendlyUnitsMessage (DtVreMessage *msg) |
Additional Inherited Members | |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtFriendlyUnitsLogic::DtFriendlyUnitsLogic | ( | ) |
Constructor for DtFriendlyUnitsLogic.
Initializes the component with the name "DtFriendlyUnitsLogic".
|
overridevirtual |
Virtual destructor for DtFriendlyUnitsLogic.
|
overridevirtual |
Initializes the component with configuration from Lua.
Sets up a message handler for EntityFriendlyUnitsMessages.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing initialization parameters |
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization setup.
Currently just returns true as there's no additional setup needed.
Reimplemented from makVre::DtPlayerComponent.
|
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.
Removes the EntityFriendlyUnitsMessage handler.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the type identifier for this component.
Implements makVre::DtPlayerComponent.
|
overrideprotectedvirtual |
Initializes state attributes (empty implementation)
This method is reserved for initializing state attributes, but currently has an empty implementation with commented-out code for potential future use.
Reimplemented from makVre::DtPlayerComponent.
|
protected |
Handles messages about friendly units.
Processes EntityFriendlyUnitsMessages by extracting the list of friendly units and updating the "subordinateList" and "taskableEntities" state attributes.
| msg | The message to process |