VR-Engage  2.3
Loading...
Searching...
No Matches
vrfObjectStateRepositoryUtil.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vrfObjectStateRepositoryUtil.h
7//! \ingroup vreVrfobjcore
8//! \brief Utility functions for VRF object state repositories
9//!
10//! This file contains utility functions associated with the DtVrfObjectStateRepository class
11//! and related functionality. It provides helpers for determining player control status
12//! of simulation entities.
13
14#pragma once
15
17
18#include <string>
19
20class DtSimObject;
21class DtLocalObjectManager;
22
23namespace makVre
24{
25//! \brief Component name for the movement chooser
26//!
27//! Constant string defining the component name for the movement chooser system.
28//! Used for component lookups when determining player control status.
29constexpr char DtMovementChooserComponentName[] = "base-system.movement.movement-chooser";
30
31//! \brief Checks if an entity is under player control
32//! \param stateRep Reference to the simulation object to check
33//! \return True if the entity is currently under player control in any role, false otherwise
34//!
35//! This function determines whether a simulation entity is currently being controlled
36//! by a player in any role. It checks the entity's components to see if a player has
37//! assumed control in roles such as driver, gunner, commander, etc.
38VREVRFOBJCORE_DLL bool isPlayerControlled(const DtSimObject& stateRep);
39
40//! \brief Checks if an entity is under player control in a specific role
41//! \param stateRep Reference to the simulation object to check
42//! \param roleType Role type to check in the entity's published "Roles" map
43//! \return True if the entity is currently controlled by a player in the specified role, false otherwise
44//!
45//! This function determines whether a simulation entity is currently being controlled
46//! by a player in the specified role. It checks whether the role's published
47//! state-property entry contains at least one player-station entry.
48VREVRFOBJCORE_DLL bool isPlayerControlledAs(const DtSimObject& stateRep, const std::string& roleType);
49
50VREVRFOBJCORE_DLL void setLocalObjectManager(DtLocalObjectManager* mgr);
52} // namespace makVre
Export macros for the VREngage Object Core library.
#define VREVRFOBJCORE_DLL
Platform-specific DLL export/import declaration.
Definition export.h:27
!
Definition glsVreMessageUtil.h:50
VREVRFOBJCORE_DLL DtLocalObjectManager * getLocalObjectManager()
constexpr char DtMovementChooserComponentName[]
Component name for the movement chooser.
Definition vrfObjectStateRepositoryUtil.h:29
VREVRFOBJCORE_DLL bool isPlayerControlledAs(const DtSimObject &stateRep, const std::string &roleType)
Checks if an entity is under player control in a specific role.
VREVRFOBJCORE_DLL bool isPlayerControlled(const DtSimObject &stateRep)
Checks if an entity is under player control.
VREVRFOBJCORE_DLL void setLocalObjectManager(DtLocalObjectManager *mgr)