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

Detailed Description

DtVreOccupancyDirectorController extends the base occupancy director to provide VR-Engage specific functionality for managing embarkation slots and entity roles. It handles entity embarkation requests, manages slot assignments, and provides information about available ingress/egress points and actions.

This controller is particularly useful for managing complex vehicles with multiple occupancy positions, each with potentially different roles, such as driver, gunner, commander, or passengers. It supports both scripted and interactive embarkation/disembarkation.

Uses Descriptor Type: DtOccupancyDirectorControllerDescriptor

#include <vreOccupancyDirectorController.h>

Inheritance diagram for makVre::DtVreOccupancyDirectorController:
[legend]

Public Member Functions

 DtVreOccupancyDirectorController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreOccupancyDirectorController () override
 
virtual const char * type () const override
 
- Public Member Functions inherited from makVre::DtVreSimComponent< DtOccupancyDirectorController >
 DtVreSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreSimComponent ()
 
bool isPlayerControlled (const std::string &role="") const
 
DtString entitySystemName () const
 

Static Public Member Functions

static DtSimComponent * creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 

Protected Member Functions

virtual bool reserveSlot (const DtEmbarkationSlotInformation &entry, const DtUUID &uuid) override
 
virtual void giveUpSlot (int iSlot, const DtUUID &name) override
 
virtual makVre::DtVreMessageResult handleEntityEmbarkationInformationRequestMessage (makVre::DtVreMessage *msg)
 
virtual void generateEmbarkedActionPoints (const DtEntityType &forType, std::vector< EntityEmbarkationInformationMessage::ActionPoint > &actionPoints)
 
virtual bool generateUnembarkedActionPoints (const DtEntityType &forType, std::vector< EntityEmbarkationInformationMessage::ActionPoint > &actionPoints)
 

Constructor & Destructor Documentation

◆ DtVreOccupancyDirectorController()

makVre::DtVreOccupancyDirectorController::DtVreOccupancyDirectorController ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )

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 occupancy director controller component with the specified parameters. Initializes the embarkation slot management and message handling functionality.

◆ ~DtVreOccupancyDirectorController()

virtual makVre::DtVreOccupancyDirectorController::~DtVreOccupancyDirectorController ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the occupancy director controller component.

Member Function Documentation

◆ type()

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

Gets the type identifier for this component.

Returns
String identifying the component type (DtVreOccupancyDirectorControllerType)

Implements the DtSimComponent::type() method to return the type identifier for this component.

◆ creator()

static DtSimComponent * makVre::DtVreOccupancyDirectorController::creator ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc = 0,
DtReaderWriterRegistry * parentRegistry = 0 )
static

Factory method to create a new instance of this component.

Parameters
nameThe name for the new component
ownerThe local object that will own this component
simManagerThe simulation services manager
descOptional component descriptor
parentRegistryOptional parent registry for reader/writer functionality
Returns
Pointer to the newly created component

Static factory method used by the component creation system to instantiate new instances of this component type.

◆ reserveSlot()

virtual bool makVre::DtVreOccupancyDirectorController::reserveSlot ( const DtEmbarkationSlotInformation & entry,
const DtUUID & uuid )
overrideprotectedvirtual

Reserves an embarkation slot for an entity.

Parameters
entryInformation about the embarkation slot to reserve
uuidUUID of the entity reserving the slot
Returns
True if the slot was successfully reserved, false otherwise

Extends the base class reserveSlot to assign the slot-defined role name to the entity (typically a human player) when embarking. This allows proper role assignment for entity appearance and functionality within the vehicle.

◆ giveUpSlot()

virtual void makVre::DtVreOccupancyDirectorController::giveUpSlot ( int iSlot,
const DtUUID & name )
overrideprotectedvirtual

Releases a previously reserved embarkation slot.

Parameters
iSlotIndex of the slot to release
nameUUID of the entity giving up the slot

Releases a previously reserved embarkation slot, making it available for other entities to occupy. Also handles any role changes needed when the entity disembarks from the vehicle.

◆ handleEntityEmbarkationInformationRequestMessage()

virtual makVre::DtVreMessageResult makVre::DtVreOccupancyDirectorController::handleEntityEmbarkationInformationRequestMessage ( makVre::DtVreMessage * msg)
protectedvirtual

Handles entity embarkation information request messages.

Parameters
msgThe message containing the embarkation information request
Returns
Message processing result indicating success or failure

Processes messages requesting information about embarkation possibilities for a specific entity. Generates and returns information about available slots, ingress points, and associated actions.

◆ generateEmbarkedActionPoints()

virtual void makVre::DtVreOccupancyDirectorController::generateEmbarkedActionPoints ( const DtEntityType & forType,
std::vector< EntityEmbarkationInformationMessage::ActionPoint > & actionPoints )
protectedvirtual

Generates a list of actionable points for an embarked entity.

Parameters
forTypeThe entity type to generate action points for
actionPointsOutput vector to be filled with generated action points

Generates a list of actionable points for an entity that is already embarked in the vehicle. Points can be either unoccupied slots (for changing positions) or egress points that map to a slot with a defined egressTechnique.

The egressTechnique string should be a script task name that opens the appropriate door for disembarkation. The egress point used is the first point in the route.

◆ generateUnembarkedActionPoints()

virtual bool makVre::DtVreOccupancyDirectorController::generateUnembarkedActionPoints ( const DtEntityType & forType,
std::vector< EntityEmbarkationInformationMessage::ActionPoint > & actionPoints )
protectedvirtual

Generates a list of actionable points for an entity wishing to embark.

Parameters
forTypeThe entity type to generate action points for
actionPointsOutput vector to be filled with generated action points
Returns
True if applicable points exist (even if all occupied), false if no points exist for the entity type

Generates a list of actionable points for entities of the given type that wish to embark on the vehicle. Points are ingress points that either map to a single slot, or map to more than one slot where at least one slot defines an ingressTechnique.

The ingressTechnique string should be a script task name that opens the appropriate door for embarkation. The egress point used is the last point in the route.

Returns true if points were found, although the list may be empty if all are occupied. Returns false if no points exist for the given entity type.


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