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

Detailed Description

The DtDisembarkControlLogic component provides functionality for disembarking (exiting) from a vehicle or other parent entity. It handles the "disembark" action from the menu system and sends appropriate messages to either trigger actual disembarkation in the simulation or to return to the role selection screen.

The behavior depends on whether the current role is stacked on another role (typically a Human role) or if it is a standalone role.

#include <disembarkControlLogic.h>

Inheritance diagram for makVre::DtDisembarkControlLogic:
[legend]

Public Member Functions

 DtDisembarkControlLogic ()
 
virtual ~DtDisembarkControlLogic () override
 
virtual bool initialize (DtPlayerStation *player, DtInitTable &config) override
 
virtual void tick (double dt) override
 
virtual void shutdown () override
 
virtual const char * type () const override
 
virtual DtVreMessageResult handleMenuMessage (makVre::DtVreMessage *msg)
 
- Public Member Functions inherited from makVre::DtPlayerComponent
 DtPlayerComponent ()
 
virtual ~DtPlayerComponent ()
 
virtual bool postInitialize ()
 
virtual void setName (const std::string &name)
 
virtual const std::string & name ()
 
virtual DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () const
 

Protected Attributes

bool myIsStackedRole
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Additional Inherited Members

- Protected Member Functions inherited from makVre::DtPlayerComponent
virtual void initializeStateAttributes ()
 

Constructor & Destructor Documentation

◆ DtDisembarkControlLogic()

makVre::DtDisembarkControlLogic::DtDisembarkControlLogic ( )

Constructor for DtDisembarkControlLogic.

Initializes the component with default values.

◆ ~DtDisembarkControlLogic()

virtual makVre::DtDisembarkControlLogic::~DtDisembarkControlLogic ( )
overridevirtual

Virtual destructor for DtDisembarkControlLogic.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtDisembarkControlLogic::initialize ( DtPlayerStation * player,
DtInitTable & config )
overridevirtual

Initializes the component with configuration from Lua.

Sets up a message handler for the MenuActionMessage type and determines whether this role is stacked on a base role or is standalone.

Parameters
playerPointer to the player station this component belongs to
configConfiguration table containing initialization parameters
Returns
True if initialization succeeds, false otherwise

Reimplemented from makVre::DtPlayerComponent.

References makVre::DtPlayerComponent::player().

◆ tick()

virtual void makVre::DtDisembarkControlLogic::tick ( double dt)
overridevirtual

Updates the component state (empty implementation)

This method is called each frame but currently has no implementation.

Parameters
dtDelta time in seconds since the last tick

Implements makVre::DtPlayerComponent.

◆ shutdown()

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

Shuts down the component.

Removes the MenuActionMessage handler to prevent duplicate processing.

Reimplemented from makVre::DtPlayerComponent.

◆ type()

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

Returns the type identifier for this component.

Returns
The type string for DtDisembarkControlLogic

Implements makVre::DtPlayerComponent.

◆ handleMenuMessage()

virtual DtVreMessageResult makVre::DtDisembarkControlLogic::handleMenuMessage ( makVre::DtVreMessage * msg)
virtual

Handles menu action messages.

Processes the "disembark" menu action. If this is a stacked role, sends a VrfSetEmbarkMessage to disembark the base player from its parent entity. If this is a standalone role, sends a UIChooseRoleButtonClickedMessage to return to the role selection screen.

After processing the disembark action, removes itself as a handler to prevent duplicate processing.

Parameters
msgThe message to process
Returns
HANDLED if the message was processed, IGNORED otherwise

Member Data Documentation

◆ myIsStackedRole

bool makVre::DtDisembarkControlLogic::myIsStackedRole
protected

Flag indicating if this role is stacked on another role.

True if this is a stacked role (typically stacked on a Human role), false if this is a standalone role. Affects disembarkation behavior.


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