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

Detailed Description

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>

Inheritance diagram for makVre::DtFriendlyUnitsConnector:
[legend]

Public Member Functions

 DtFriendlyUnitsConnector ()
 
virtual ~DtFriendlyUnitsConnector () override
 
virtual void install (DtPlayerStationApp *app, makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection *connection) override
 
virtual void tick () override
 
virtual void shutdown () override
 
virtual void handleEntityListChanged (DtReflectedEntity *ent)
 
virtual void handleAggregateListChanged (DtReflectedAggregate *agg)
 
- Public Member Functions inherited from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector
 DtSimEventConnector ()
 
virtual ~DtSimEventConnector () override
 
- Public Member Functions inherited from makVre::DtConnector
 DtConnector ()
 
virtual ~DtConnector ()
 
virtual DtConnectorType type ()
 
virtual std::string name ()
 

Protected Member Functions

void updateNames ()
 

Protected Attributes

DtForceType myForceId
 
DtEntityIdentifier myEntityId
 
DtReflectedEntityList * myRel
 
DtReflectedAggregateList * myRal
 
bool myUpdateNeeded
 
- Protected Attributes inherited from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector
DtPlayerStationAppmyApp
 
makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection * myConnection
 
- Protected Attributes inherited from makVre::DtConnector
std::string myName
 
DtConnectorType myType
 

Additional Inherited Members

- Public Types inherited from makVre::DtConnector
enum  DtConnectorType {
  DIS , HLA13 , HLA1516 , HLA1516E ,
  HLA4
}
 
- Static Public Member Functions inherited from makVre::DtConnector
static std::string extension (DtConnectorType type)
 

Constructor & Destructor Documentation

◆ 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

Virtual destructor.

Member Function Documentation

◆ 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
appPointer to the player station application
connectionPointer 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

Performs periodic checking of friendly units.

Determines the player's force ID if not yet known and updates the friendly units list if changes have been detected

Reimplemented from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector.

◆ shutdown()

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

Shuts down the friendly units connector.

Removes entity and aggregate callbacks and cleans up resources

Reimplemented from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector.

◆ handleEntityListChanged()

virtual void makVre::DtFriendlyUnitsConnector::handleEntityListChanged ( DtReflectedEntity * ent)
virtual

Handles changes to the entity list.

Parameters
entPointer 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
aggPointer 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

Member Data Documentation

◆ 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: