VR-Engage  2.3
Loading...
Searching...
No Matches
vreWeaponControllerDescriptor.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreWeaponControllerDescriptor.h
7//! \ingroup vreVrfobjparam
8//! \brief Weapon controller descriptor for VREngage
9//!
10//! This file defines the DtVreWeaponControllerDescriptor class, which configures
11//! weapon controller components in VREngage. It extends the base weapon controller
12//! descriptor to add equipment resource type configuration and ammunition selection
13//! capabilities.
14
15#pragma once
16
18
19#include <vrfobjparam/weaponControllerDescriptor.h>
20#include <vrfutil/rwResource.h>
21#include <readerWriter/rwBoolean.h>
22
23namespace makVre
24{
25//! \brief Type identifier string for the weapon controller descriptor
26const char DtVreWeaponControllerDescriptorType[] = "vre-weapon-controller-descriptor";
27
28//! \brief Weapon controller descriptor for VREngage
29//!
30//! This class extends the base weapon controller descriptor to add configuration for
31//! equipment resource types and ammunition selection capabilities. It provides parameters
32//! for direct fire weapon controllers, allowing them to choose appropriate ammunition
33//! based on target types and maintain resource tracking.
34class VREVRFOBJPARAM_DLL DtVreWeaponControllerDescriptor : public DtWeaponControllerDescriptor
35{
36public:
37 //! \brief Constructor with component name
38 //! \param name The name of this component
39 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
40 //!
41 //! Creates a new weapon controller descriptor with the specified name.
42 DtVreWeaponControllerDescriptor(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
43
44 //! \brief Copy constructor
45 //! \param orig The source descriptor to copy from
46 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
47 //!
48 //! Creates a new weapon controller descriptor as a copy of the provided original.
50 const DtVreWeaponControllerDescriptor& orig, DtReaderWriterRegistry* parentRegistry = 0);
51
52 //! \brief Assignment operator
53 //! \param orig The source descriptor to copy from
54 //! \return Reference to this descriptor after assignment
55 //!
56 //! Assigns the contents of the provided descriptor to this one.
58
59 //! \brief Virtual destructor
60 //!
61 //! Cleans up resources used by the descriptor.
63
64 //! \brief Default constructor (deleted)
65 //!
66 //! Default constructor is explicitly deleted to prevent
67 //! creation of instances without proper initialization.
69
70 //! \brief Gets the type identifier for this descriptor
71 //! \return String identifying this descriptor type
72 //!
73 //! Returns a unique type identifier string for this descriptor type.
74 //! Will return DtVreWeaponControllerDescriptorType.
75 virtual DtString type() const override;
76
77 //! \brief Creates a clone of this descriptor
78 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
79 //! \return Pointer to a new descriptor that is a clone of this one
80 //!
81 //! Creates a new weapon controller descriptor as a deep copy of this one.
82 virtual DtComponentDescriptor* clone(DtReaderWriterRegistry* parentRegistry = 0) const override;
83
84 //! \brief Gets the equipment resource type
85 //! \return Reference to the equipment resource entity type
86 //!
87 //! Returns the type of equipment resource used by this weapon controller.
88 //! This is used for resource tracking and management in the simulation.
89 virtual const DtEntityType& equipmentResourceType() const;
90
91 //! \brief Sets the equipment resource type
92 //! \param equipmentResourceType The equipment resource entity type
93 //!
94 //! Sets the type of equipment resource used by this weapon controller.
95 //! This is used for resource tracking and management in the simulation.
96 virtual void setEquipmentResourceType(const DtEntityType& equipmentResourceType);
97
98 //! \brief Gets whether the weapon has targeting modes
99 //! \return Boolean indicating if the weapon has targeting modes
100 //!
101 //! Returns whether this weapon controller supports multiple targeting modes.
102 virtual bool hasTargetingModes() const;
103
104 //! \brief Sets whether the weapon has targeting modes
105 //! \param hasTargetingModes Boolean indicating if the weapon has targeting modes
106 //!
107 //! Sets whether this weapon controller supports multiple targeting modes.
109
110 //! \brief Factory function to create a new instance of this descriptor
111 //! \return Pointer to a newly created descriptor
112 //!
113 //! Static factory function used by the descriptor creation system to instantiate
114 //! new instances of this descriptor type.
115 static DtComponentDescriptor* creator();
116
117protected:
118 //! \brief Equipment resource entity type
119 //!
120 //! The type of equipment resource used by this weapon controller.
121 //! This is used for resource tracking and management in the simulation.
122 //! Parameter name: "equipment-resource"
124
125 //! \brief Indicates whether the weapon has targeting modes
126 //!
127 //! Boolean flag indicating if this weapon controller supports multiple targeting modes.
128 //! Parameter name: "has-targeting-modes"
130};
131} // namespace makVre
virtual const DtEntityType & equipmentResourceType() const
Gets the equipment resource type.
virtual void setHasTargetingModes(bool hasTargetingModes)
Sets whether the weapon has targeting modes.
virtual DtString type() const override
Gets the type identifier for this descriptor.
virtual ~DtVreWeaponControllerDescriptor() override
Virtual destructor.
virtual bool hasTargetingModes() const
Gets whether the weapon has targeting modes.
static DtComponentDescriptor * creator()
Factory function to create a new instance of this descriptor.
DtRwResource myEquipmentResourceType
Equipment resource entity type.
Definition vreWeaponControllerDescriptor.h:123
virtual DtComponentDescriptor * clone(DtReaderWriterRegistry *parentRegistry=0) const override
Creates a clone of this descriptor.
DtVreWeaponControllerDescriptor()=delete
Default constructor (deleted)
DtRwBoolean myHasTargetingModes
Indicates whether the weapon has targeting modes.
Definition vreWeaponControllerDescriptor.h:129
DtVreWeaponControllerDescriptor & operator=(const DtVreWeaponControllerDescriptor &orig)
Assignment operator.
DtVreWeaponControllerDescriptor(const DtString &name, DtReaderWriterRegistry *parentRegistry=0)
Constructor with component name.
virtual void setEquipmentResourceType(const DtEntityType &equipmentResourceType)
Sets the equipment resource type.
DtVreWeaponControllerDescriptor(const DtVreWeaponControllerDescriptor &orig, DtReaderWriterRegistry *parentRegistry=0)
Copy constructor.
Export macros for the VREngage Object Parameter library.
#define VREVRFOBJPARAM_DLL
Platform-specific DLL export/import declaration.
Definition export.h:27
!
Definition glsVreMessageUtil.h:50
const char DtVreWeaponControllerDescriptorType[]
Type identifier string for the weapon controller descriptor.
Definition vreWeaponControllerDescriptor.h:26