VR-Engage  2.3
Loading...
Searching...
No Matches
makVre::DtVreSimComponent< ComponentBase > Class Template Reference

Detailed Description

template<typename ComponentBase>
class makVre::DtVreSimComponent< ComponentBase >
Template Parameters
ComponentBaseThe base component class to extend with VR-Engage functionality

DtVreSimComponent is a template class that serves as the base for VR-Engage simulation components. It extends VR-Forces base component classes with VR-Engage specific functionality such as player control detection and entity system name retrieval. All VR-Engage components should derive from this template class.

#include <vreSimComponent.h>

Inheritance diagram for makVre::DtVreSimComponent< ComponentBase >:
[legend]

Public Member Functions

 DtVreSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreSimComponent ()
 
bool isPlayerControlled (const std::string &role="") const
 
std::vector< std::string > controllingStations (const std::string &role) const
 
std::vector< std::string > engagedRoles () const
 
DtString entitySystemName () const
 

Private Member Functions

 DtVreSimComponent ()
 
 DtVreSimComponent (const DtVreSimComponent &other)
 
DtVreSimComponent & operator= (const DtVreSimComponent &other)
 

Constructor & Destructor Documentation

◆ DtVreSimComponent() [1/3]

template<typename ComponentBase>
makVre::DtVreSimComponent< ComponentBase >::DtVreSimComponent ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )
inline

Constructor.

Parameters
nameThe name of this component
ownerThe local object that owns this component
simManagerThe simulation services manager
descComponent descriptor with configuration parameters
parentRegistryOptional parent registry for reader/writer functionality

Creates a new VR-Engage simulation component with the specified parameters. Forwards all parameters to the base component class constructor.

◆ ~DtVreSimComponent()

template<typename ComponentBase>
virtual makVre::DtVreSimComponent< ComponentBase >::~DtVreSimComponent ( )
inlinevirtual

Virtual destructor.

Cleans up resources used by the VR-Engage simulation component. Base component resources are cleaned up by the base class destructor.

◆ DtVreSimComponent() [2/3]

template<typename ComponentBase>
makVre::DtVreSimComponent< ComponentBase >::DtVreSimComponent ( )
private

Default constructor (not implemented)

Default constructor is private and not implemented to prevent creation of instances without proper initialization.

◆ DtVreSimComponent() [3/3]

template<typename ComponentBase>
makVre::DtVreSimComponent< ComponentBase >::DtVreSimComponent ( const DtVreSimComponent< ComponentBase > & other)
private

Copy constructor (not implemented)

Copy constructor is private and not implemented to prevent copy construction.

Member Function Documentation

◆ isPlayerControlled()

template<typename ComponentBase>
bool makVre::DtVreSimComponent< ComponentBase >::isPlayerControlled ( const std::string & role = "") const
inline

Checks if the entity is player controlled.

Parameters
roleOptional role name to check for (empty string to check for any role)
Returns
True if the entity has the specified role, or any role if none is provided

Determines whether the entity is under player control by inspecting the published "Roles" state-property map. If a specific role is provided, returns true when that role's station-entry list is non-empty. If no role is provided, returns true when any role is occupied by at least one station.

◆ controllingStations()

template<typename ComponentBase>
std::vector< std::string > makVre::DtVreSimComponent< ComponentBase >::controllingStations ( const std::string & role) const
inline

Returns the identifiers of the stations controlling a given role.

Parameters
roleThe role name to query
Returns
The controlling station identifiers, or an empty vector if the role is unoccupied

Reads the published "Roles" state-property map and returns the station identifiers from the structured station list associated with role.

◆ engagedRoles()

template<typename ComponentBase>
std::vector< std::string > makVre::DtVreSimComponent< ComponentBase >::engagedRoles ( ) const
inline

Returns the names of all roles occupied by at least one station.

Returns
Role names whose controlling-station list is non-empty

Reads the published "Roles" state-property map and returns each role name (map key) that currently has one or more controlling stations.

◆ entitySystemName()

template<typename ComponentBase>
DtString makVre::DtVreSimComponent< ComponentBase >::entitySystemName ( ) const
inline

Gets the entity's top-level system name.

Returns
String containing the top-level system name from the entity definition

Retrieves the name of the top-level system (direct child of base-system) defined in the entity file. This is extracted from the full parent system name by removing the "base-system." prefix and any suffixes after the first period.

Note
This implementation uses string manipulation since DtComponentSystem does not provide a direct accessor for the top-level system name.

◆ operator=()

template<typename ComponentBase>
DtVreSimComponent & makVre::DtVreSimComponent< ComponentBase >::operator= ( const DtVreSimComponent< ComponentBase > & other)
private

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.


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