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

Detailed Description

DtVreLauncherController extends the base launcher controller to add equipment status monitoring functionality. It tracks the state of associated equipment resources and updates weapon availability based on the equipment status. This allows for disabling missile systems when the associated equipment is damaged or unavailable.

#include <vreLauncherController.h>

Inheritance diagram for makVre::DtVreLauncherController:
[legend]

Public Member Functions

 DtVreLauncherController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreLauncherController () override
 
 DtVreLauncherController ()=delete
 
 DtVreLauncherController (const DtVreLauncherController &orig)=delete
 
const DtVreLauncherControlleroperator= (const DtVreLauncherController &orig)=delete
 
virtual const char * type () const override
 
virtual void tick () override
 
virtual void onRestore () override
 
- Public Member Functions inherited from makVre::DtVreSimComponent< DtLauncherController >
 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 void preFirstTickInit () override
 

Protected Attributes

DtSimResource * myEquipmentResource
 

Private Member Functions

virtual DtSimResource * lookupEquipmentResource ()
 

Constructor & Destructor Documentation

◆ DtVreLauncherController() [1/3]

makVre::DtVreLauncherController::DtVreLauncherController ( 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 launcher controller component with the specified parameters.

Referenced by DtVreLauncherController(), and operator=().

◆ ~DtVreLauncherController()

virtual makVre::DtVreLauncherController::~DtVreLauncherController ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the launcher controller component.

◆ DtVreLauncherController() [2/3]

makVre::DtVreLauncherController::DtVreLauncherController ( )
delete

Default constructor (deleted)

Default constructor is deleted to prevent creation of instances without proper initialization.

◆ DtVreLauncherController() [3/3]

makVre::DtVreLauncherController::DtVreLauncherController ( const DtVreLauncherController & orig)
delete

Copy constructor (deleted)

Copy constructor is deleted to prevent copy construction.

References DtVreLauncherController().

Member Function Documentation

◆ operator=()

const DtVreLauncherController & makVre::DtVreLauncherController::operator= ( const DtVreLauncherController & orig)
delete

Assignment operator (deleted)

Returns
Reference to this object

Assignment operator is deleted to prevent assignment.

References DtVreLauncherController().

◆ type()

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

Gets the type identifier for this component.

Returns
String identifying the component type (DtVreLauncherControllerType)

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

◆ tick()

virtual void makVre::DtVreLauncherController::tick ( )
overridevirtual

Updates the controller state each simulation frame.

Checks myEquipmentResource. If it's null, attempts to look it up and cache it, which will happen after a reset. If myEquipmentResource is non-null, updates the DtWeaponComponentInterface::DT_WEAPON_DISABLED flag based on whether or not the value of this resource is non-zero. This allows the weapon system to be disabled when the associated equipment is damaged or unavailable.

◆ creator()

static DtSimComponent * makVre::DtVreLauncherController::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.

◆ onRestore()

virtual void makVre::DtVreLauncherController::onRestore ( )
overridevirtual

Handles component restoration.

Called whenever a component is restored from a saved state. Sets myEquipmentResource to null, forcing it to be looked up again on the next tick. This ensures proper initialization after scenario restoration.

◆ preFirstTickInit()

virtual void makVre::DtVreLauncherController::preFirstTickInit ( )
overrideprotectedvirtual

Performs initialization before the first simulation tick.

Initializes the myMissileSimObjectFacadeMap and performs other one-time initialization tasks that must be completed before the first simulation tick occurs.

◆ lookupEquipmentResource()

virtual DtSimResource * makVre::DtVreLauncherController::lookupEquipmentResource ( )
privatevirtual

Looks up the appropriate equipment resource.

Returns
Pointer to the equipment resource, or nullptr if not found

Searches for and returns a pointer to the equipment resource that affects this launcher's availability. This method is called when the resource pointer is null, typically after initialization or reset.

Member Data Documentation

◆ myEquipmentResource

DtSimResource* makVre::DtVreLauncherController::myEquipmentResource
protected

Pointer to the equipment resource being monitored.

Stores a reference to the equipment resource that affects the availability of this launcher system. When this resource value becomes zero (indicating damaged or unavailable equipment), the launcher is disabled.


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