VR-Engage  2.2
Loading...
Searching...
No Matches
vreAmmunitionParamsEntry.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreAmmunitionParamsEntry.h
7//! \ingroup vreVrfobjparam
8//! \brief Ammunition parameter entry for VREngage
9//!
10//! This file defines the DtVreAmmunitionParamsEntry class, which represents
11//! a single ammunition type entry in VREngage's ammunition parameter database.
12//! It provides ballistic properties and load time configuration for ammunition.
13
14#pragma once
16
17#include <vrfobjparam/ammunitionParamsEntry.h>
18#include <vrfUtil/rwTemplatedList.h>
19
20namespace makVre
21{
22//! \brief Ammunition parameter entry for VREngage weapon systems
23//!
24//! The DtVreAmmunitionParamsEntry contains fields loaded from ammunitionParams.mtl
25//! via DtVreAmmunitionManager. It stores physical and ballistic properties of ammunition,
26//! including cross-section, drag coefficient, mass, and load time.
27class VREVRFOBJPARAM_DLL DtVreAmmunitionParamsEntry : public DtAmmunitionParamsEntry
28{
29public:
30 //! \brief Templated list type for ammunition parameter entries
31 //!
32 //! This type defines a reader/writer templated list of ammunition parameter entries
33 //! with automatic memory management (pointer ownership).
34 using DtVreAmmunitionParamsEntryList = DtRwTemplatedListPtr<DtVreAmmunitionParamsEntry*, true>;
35
36 //! \brief Constructor with entry name
37 //! \param name The name of this ammunition entry
38 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
39 //!
40 //! Creates a new ammunition parameter entry with the specified name.
41 DtVreAmmunitionParamsEntry(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL);
42
43 //! \brief Constructor with entry name as symbol string
44 //! \param name The name of this ammunition entry as a symbol string
45 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
46 //!
47 //! Creates a new ammunition parameter entry with the specified name.
48 DtVreAmmunitionParamsEntry(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL);
49
50 //! \brief Virtual destructor
51 //!
52 //! Cleans up resources used by the ammunition parameter entry.
53 virtual ~DtVreAmmunitionParamsEntry() override;
54
55 //! \brief Copy constructor with name
56 //! \param name The name for the new entry
57 //! \param orig The source entry to copy from
58 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
59 //!
60 //! Creates a new ammunition parameter entry as a copy of the provided original.
62 const DtString& name, const DtVreAmmunitionParamsEntry& orig, DtReaderWriterRegistry* parentRegistry = NULL);
63
64 //! \brief Copy constructor with name as symbol string
65 //! \param name The name for the new entry as a symbol string
66 //! \param orig The source entry to copy from
67 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
68 //!
69 //! Creates a new ammunition parameter entry as a copy of the provided original.
70 DtVreAmmunitionParamsEntry(const DtSymbolString& name, const DtVreAmmunitionParamsEntry& orig,
71 DtReaderWriterRegistry* parentRegistry = NULL);
72
73 //! \brief Assignment operator
74 //! \param orig The source entry to copy from
75 //! \return Reference to this entry after assignment
76 //!
77 //! Assigns the contents of the provided entry to this one.
79
80 //! \brief Creates a clone of this entry
81 //! \param parent Parent registry for reader/writer functionality (optional)
82 //! \return Pointer to a new entry that is a clone of this one
83 //!
84 //! Creates a new ammunition parameter entry as a deep copy of this one.
85 virtual DtVreAmmunitionParamsEntry* clone(DtReaderWriterRegistry* parent = 0) const override;
86
87 //! \brief Equality operator
88 //! \param other The entry to compare with
89 //! \return True if the entries are equal, false otherwise
90 //!
91 //! Compares this entry with another to determine if they are equal.
92 bool operator==(const DtVreAmmunitionParamsEntry& other) const;
93
94 //! \brief Inequality operator
95 //! \param rhs The entry to compare with
96 //! \return True if the entries are not equal, false otherwise
97 //!
98 //! Compares this entry with another to determine if they are not equal.
99 bool operator!=(const DtVreAmmunitionParamsEntry& rhs) { return !(*this == rhs); }
100
101 //! \name Ammunition Properties
102 //! @{
103
104 //! \brief Gets the cross-section of the projectile
105 //! \return The cross-section (diameter) of the projectile
106 //!
107 //! Returns the cross-sectional diameter of the projectile, which affects
108 //! its ballistic trajectory and impact characteristics.
109 double crossSection() const { return myCrossSection; }
110
111 //! \brief Sets the cross-section of the projectile
112 //! \param crossSection The cross-section (diameter) of the projectile
113 //!
114 //! Sets the cross-sectional diameter of the projectile, which affects
115 //! its ballistic trajectory and impact characteristics.
117
118 //! \brief Gets the drag coefficient of the projectile
119 //! \return The drag coefficient value
120 //!
121 //! Returns the drag coefficient of the projectile, which determines
122 //! how much air resistance affects its flight path.
123 double dragCoefficient() const { return myDragCoefficient; }
124
125 //! \brief Sets the drag coefficient of the projectile
126 //! \param dragCoefficient The drag coefficient value
127 //!
128 //! Sets the drag coefficient of the projectile, which determines
129 //! how much air resistance affects its flight path.
131
132 //! \brief Gets the mass of the projectile
133 //! \return The mass of the projectile in kilograms
134 //!
135 //! Returns the mass of the projectile in kilograms, which affects
136 //! its ballistic trajectory, range, and impact force.
137 double projectileMass() const { return myProjectileMass; }
138
139 //! \brief Sets the mass of the projectile
140 //! \param projectileMass The mass of the projectile in kilograms
141 //!
142 //! Sets the mass of the projectile in kilograms, which affects
143 //! its ballistic trajectory, range, and impact force.
145
146 //! \brief Gets the loading time for this ammunition
147 //! \return The loading time in seconds
148 //!
149 //! Returns the time required to load this ammunition type into a weapon,
150 //! which affects weapon rate of fire and tactical considerations.
151 double loadTime() const { return myLoadTime; }
152
153 //! \brief Sets the loading time for this ammunition
154 //! \param loadTime The loading time in seconds
155 //!
156 //! Sets the time required to load this ammunition type into a weapon,
157 //! which affects weapon rate of fire and tactical considerations.
158 virtual void setLoadTime(double loadTime) { myLoadTime = loadTime; }
159
160 //! @}
161
162protected:
163 //! \brief The cross-section (diameter) of the projectile
164 //!
165 //! Affects the projectile's ballistic trajectory and impact characteristics.
167
168 //! \brief The drag coefficient of the projectile
169 //!
170 //! Determines how much air resistance affects the projectile's flight path.
172
173 //! \brief The mass of the projectile in kilograms
174 //!
175 //! Affects the projectile's ballistic trajectory, range, and impact force.
177
178 //! \brief The time required to load this ammunition in seconds
179 //!
180 //! Determines how quickly this ammunition type can be loaded into a weapon.
181 DtRwReal myLoadTime;
182};
183} // namespace makVre
DtRwTemplatedListPtr< DtVreAmmunitionParamsEntry *, true > DtVreAmmunitionParamsEntryList
Templated list type for ammunition parameter entries.
Definition vreAmmunitionParamsEntry.h:34
virtual DtVreAmmunitionParamsEntry * clone(DtReaderWriterRegistry *parent=0) const override
Creates a clone of this entry.
double projectileMass() const
Gets the mass of the projectile.
Definition vreAmmunitionParamsEntry.h:137
virtual void setDragCoefficient(double dragCoefficient)
Sets the drag coefficient of the projectile.
Definition vreAmmunitionParamsEntry.h:130
double loadTime() const
Gets the loading time for this ammunition.
Definition vreAmmunitionParamsEntry.h:151
double crossSection() const
Gets the cross-section of the projectile.
Definition vreAmmunitionParamsEntry.h:109
DtRwReal myDragCoefficient
The drag coefficient of the projectile.
Definition vreAmmunitionParamsEntry.h:171
DtRwReal myProjectileMass
The mass of the projectile in kilograms.
Definition vreAmmunitionParamsEntry.h:176
virtual void setCrossSection(double crossSection)
Sets the cross-section of the projectile.
Definition vreAmmunitionParamsEntry.h:116
bool operator!=(const DtVreAmmunitionParamsEntry &rhs)
Inequality operator.
Definition vreAmmunitionParamsEntry.h:99
virtual void setLoadTime(double loadTime)
Sets the loading time for this ammunition.
Definition vreAmmunitionParamsEntry.h:158
double dragCoefficient() const
Gets the drag coefficient of the projectile.
Definition vreAmmunitionParamsEntry.h:123
DtRwReal myLoadTime
The time required to load this ammunition in seconds.
Definition vreAmmunitionParamsEntry.h:181
DtVreAmmunitionParamsEntry(const DtString &name, const DtVreAmmunitionParamsEntry &orig, DtReaderWriterRegistry *parentRegistry=NULL)
Copy constructor with name.
virtual void setProjectileMass(double projectileMass)
Sets the mass of the projectile.
Definition vreAmmunitionParamsEntry.h:144
virtual ~DtVreAmmunitionParamsEntry() override
Virtual destructor.
DtVreAmmunitionParamsEntry(const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL)
Constructor with entry name as symbol string.
DtVreAmmunitionParamsEntry(const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL)
Constructor with entry name.
DtVreAmmunitionParamsEntry & operator=(const DtVreAmmunitionParamsEntry &orig)
Assignment operator.
DtRwReal myCrossSection
The cross-section (diameter) of the projectile.
Definition vreAmmunitionParamsEntry.h:166
bool operator==(const DtVreAmmunitionParamsEntry &other) const
Equality operator.
DtVreAmmunitionParamsEntry(const DtSymbolString &name, const DtVreAmmunitionParamsEntry &orig, DtReaderWriterRegistry *parentRegistry=NULL)
Copy constructor with name as symbol string.
Export macros for the VREngage Object Parameter library.
#define VREVRFOBJPARAM_DLL
Platform-specific DLL export/import declaration.
Definition export.h:27
Include export definitions for this library.
Definition glsVreMessageUtil.h:49