20#include <vrfobjcore/setDataManager.h>
21#include <vrfobjcore/localObject.h>
22#include <vrftasks/setDataRequest.h>
24#include <vlutil/vlString.h>
25#include <readerWriter/propertyInterface.h>
31class DtSimulationServices;
32class DtComponentDescriptor;
33class DtReaderWriterRegistry;
53template <
typename SetControllerBase>
86 DtSimulationServices* simManager,
87 DtComponentDescriptor* desc =
nullptr,
88 DtReaderWriterRegistry* parentRegistry =
nullptr);
215 const DtString& stationId,
const std::string& roleType,
const std::string& roleName)
const;
285 static DtSimComponent*
creator(
const DtString& name,
286 DtLocalObject* owner,
287 DtSimulationServices* simManager,
288 DtComponentDescriptor* desc =
nullptr,
289 DtReaderWriterRegistry* parentRegistry =
nullptr);
318#include "vreVrfModel/vreSetController.inl"
std::list< SetVreControlledContent > myPendingControlChanges
FIFO queue of pending role-control changes to apply during tick().
Definition vreSetController.h:314
virtual void setRadio(DtSimRadio *radio)
Sets the simulation radio and registers callbacks.
virtual void replayRestoredRoleAssignments()
Replays and clears restored role assignments from the "Roles" state property.
DtPropertyInterface * myDetachedRolesStateProperty
Temporarily detached top-level "Roles" state property during checkpoint save.
Definition vreSetController.h:302
static void setDisableOwnershipTransferCallback(DtSimMessage *msg, void *usrData)
Static callback function for ownership-transfer disable messages.
virtual ~DtVreSetController() override
Virtual destructor.
virtual void processPreSave(DtLocalObject::SaveType saveType)
Removes the top-level "Roles" state property before eligible saves.
virtual void processSetPlayerControlled(DtSimMessage *msg)
Processes a VR-Engage control assignment message.
virtual void sendAssignRolePlayerMessage(const DtString &stationId, const DtString &roleName)
Sends one frontend role-assignment replay message.
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
Factory method to create a new instance of this component.
virtual void updatePlayerControlled(const SetVreControlledContent &change)
Applies one queued role-occupancy change to the entity state.
virtual void processSetRestore(DtSimMessage *msg)
Restores live ownership-transfer and role-occupancy state after an entity reset.
bool myWarnedAboutResource
Flag indicating if a resource warning has been logged.
Definition vreSetController.h:296
virtual void processSetAltitude(DtSimMessage *msg)
Processes altitude setting messages with enhanced terrain handling.
bool myObjectWasTransferred
True once the entity has completed a convert-to-local handoff.
Definition vreSetController.h:299
virtual void processPostSave(DtLocalObject::SaveType saveType)
Restores the top-level "Roles" state property after eligible saves.
virtual void tick()
Updates the controller state each simulation frame.
virtual void processSetDisableOwnershipTransfer(DtSimMessage *msg)
Processes a disable-ownership-transfer request.
static void setPlayerControlledCallback(DtSimMessage *msg, void *usrData)
Static callback function for player control messages.
DtVreSetController(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=nullptr, DtReaderWriterRegistry *parentRegistry=nullptr)
Constructor.
bool isEmbarkedRoleAssignment(const DtString &stationId, const std::string &roleType, const std::string &roleName) const
Determines whether a role assignment on this entity is an embarked human role.
DtVreSetController()=delete
Default constructor (not implemented)
boost::signals2::connection myPreSaveConn
Connection for pre-save notifications from the local object.
Definition vreSetController.h:308
virtual bool shouldReplayRestoredRoleAssignment(const DtString &roleName, const DtStatePropertyRoleStationItem &stationItem)
Determines whether a restored station entry should emit a replay message.
const DtVreSetController & operator=(const DtVreSetController &orig)=delete
Assignment operator (not implemented)
boost::signals2::connection myOwnershipTransferConn
Connection for ownership-transfer notifications from the local object.
Definition vreSetController.h:305
virtual void preFirstTickInit()
Initializes the controller before the first tick.
boost::signals2::connection myPostSaveConn
Connection for post-save notifications from the local object.
Definition vreSetController.h:311
DtVreSetController(const DtVreSetController &orig)=delete
Copy constructor (not implemented)
void setLastVrfSimStateProperty(const DtString &simAddress)
Creates or updates the next-frame LastVrfSim state property.
DtVreSimComponent(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
Definition vreSimComponent.h:63
Defines export macros for the vreVrfmodel library.
!
Definition glsVreMessageUtil.h:50
One station entry from the published "Roles" state property.
Definition vreStatePropertiesUtil.h:33
Queued role-control change extracted from a set-data request.
Definition vreSetController.h:59
std::vector< std::string > myRoles
Role-type keys affected by the queued change.
Definition vreSetController.h:67
std::string myRoleName
Entity-role name stored in each affected station entry.
Definition vreSetController.h:70
DtString myStationId
Station identifier associated with the queued change.
Definition vreSetController.h:64
bool myControlled
Whether the entity should be controlled (true) or released (false).
Definition vreSetController.h:61
Base template class for VR-Engage simulation components.