DtFriendlyUnitsConnector monitors entities and aggregates that have the same force ID as the player's entity. It maintains an alphabetically sorted list of friendly unit names and sends updates when the list changes.
#include <friendlyUnitsConnector.h>
◆ DtFriendlyUnitsConnector()
| makVre::DtFriendlyUnitsConnector::DtFriendlyUnitsConnector |
( |
| ) |
|
Default constructor.
Initializes member variables with default values and sets the connector name to "FriendlyUnitsTime"
◆ ~DtFriendlyUnitsConnector()
| virtual makVre::DtFriendlyUnitsConnector::~DtFriendlyUnitsConnector |
( |
| ) |
|
|
overridevirtual |
◆ install()
| virtual void makVre::DtFriendlyUnitsConnector::install |
( |
DtPlayerStationApp * | app, |
|
|
makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection * | connection ) |
|
overridevirtual |
Installs the friendly units connector with the application and connection.
- Parameters
-
| app | Pointer to the player station application |
| connection | Pointer to the protocol-specific VR-Link connection |
Registers callbacks for entity and aggregate addition/removal and retrieves the player's entity ID and reflected entity list
Reimplemented from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector.
◆ tick()
| virtual void makVre::DtFriendlyUnitsConnector::tick |
( |
| ) |
|
|
overridevirtual |
◆ shutdown()
| virtual void makVre::DtFriendlyUnitsConnector::shutdown |
( |
| ) |
|
|
overridevirtual |
◆ handleEntityListChanged()
| virtual void makVre::DtFriendlyUnitsConnector::handleEntityListChanged |
( |
DtReflectedEntity * | ent | ) |
|
|
virtual |
Handles changes to the entity list.
- Parameters
-
| ent | Pointer to the entity that was added or removed |
Called when an entity is added to or removed from the reflected entity list Sets the update flag to trigger a refresh of the friendly units list
◆ handleAggregateListChanged()
| virtual void makVre::DtFriendlyUnitsConnector::handleAggregateListChanged |
( |
DtReflectedAggregate * | agg | ) |
|
|
virtual |
Handles changes to the aggregate list.
- Parameters
-
| agg | Pointer to the aggregate that was added or removed |
Called when an aggregate is added to or removed from the reflected aggregate list Sets the update flag to trigger a refresh of the friendly units list
◆ updateNames()
| void makVre::DtFriendlyUnitsConnector::updateNames |
( |
| ) |
|
|
protected |
Updates the list of friendly unit names and sends a message.
Collects all entities and aggregates with the same force ID as the player, sorts them alphabetically, and sends an EntityFriendlyUnitsMessage with the results
◆ myForceId
| DtForceType makVre::DtFriendlyUnitsConnector::myForceId |
|
protected |
Force ID of the player's entity.
Used to identify which entities and aggregates are friendly
◆ myEntityId
| DtEntityIdentifier makVre::DtFriendlyUnitsConnector::myEntityId |
|
protected |
Entity ID of the player's entity.
◆ myRel
| DtReflectedEntityList* makVre::DtFriendlyUnitsConnector::myRel |
|
protected |
Pointer to the reflected entity list.
◆ myRal
| DtReflectedAggregateList* makVre::DtFriendlyUnitsConnector::myRal |
|
protected |
Pointer to the reflected aggregate list.
This is created and owned by the connector, not just referenced
◆ myUpdateNeeded
| bool makVre::DtFriendlyUnitsConnector::myUpdateNeeded |
|
protected |
Flag indicating whether an update is needed.
Set to true when entities or aggregates are added or removed
The documentation for this class was generated from the following file: