VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
baseWeaponComponentInterface.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
13 #include <readerWriter/rwString.h>
14 #include <readerWriter/rwBoolean.h>
15 #include <readerWriter/rwReal.h>
16 #include <readerWriter/rwInt.h>
17 #include "readerWriter/rwVector.h"
18 #include "vlpi/disEnums.h"
19 #include "vlpi/entityType.h"
20 
21 #include <list>
22 #include <map>
23 #include <set>
24 
25 
31 {
32 public:
37  {
38  DT_OK_TO_FIRE = 0,
39  DT_WEAPON_DISABLED = 1,
40  DT_NO_AMMUNITION_FOR_TARGET = 2,
41  DT_CANNOT_ACQUIRE_TARGET = 4,
42  DT_SUPPRESSED = 8,
43  DT_OUT_OF_AMMUNITION_FOR_WEAPON = 16,
44  DT_WEAPON_BUSY = 32,
45  DT_CANNOT_ARTICULATE_TO_TARGET = 64
46  };
47 
48 private:
51 
52 public:
53 
54  //constructor
56  const DtString& rwName = DtString::nullString(),
57  DtReaderWriterRegistry* parentRegistry = 0);
58 
59  //copy constructor
61  const DtString& rwName = DtString::nullString(),
62  DtReaderWriterRegistry* parentRegistry = 0);
63 
64  //assignment operator
66  const DtBaseWeaponComponentInterface& orig);
67 
68  //destructor
69  virtual ~DtBaseWeaponComponentInterface() override;
70 
71  //returns a copy of the PSR
73  const DtString& rwName = DtString::nullString(), DtReaderWriterRegistry* parentRegistry = 0) const override = 0;
74 
77  virtual void updateRegionEvaluator() = 0;
78 
83  virtual bool locationWithinRegion(const DtVector& localLocation) const = 0;
84 
86  virtual void setRoundsFiredUponTarget(const int& roundsFired);
87  virtual const int roundsFiredUponTarget() const;
88 
90  virtual void setTotalRoundsToFireUponTarget(const int& totalRoundsToFire);
91  virtual const int totalRoundsToFireUponTarget() const;
92 
94 
95  virtual void setIsExplicitlyTasked(const bool& explicitlyTasked);
96  virtual const bool isExplicitlyTasked() const;
98 
100 
101  virtual void setAllowExplicitTasking(const bool& includeInDialogs);
102  virtual const bool allowExplicitTasking() const;
104 
106 
107  virtual void setDisplayName(const DtString& displayName);
108  virtual const DtString& displayName() const;
110 
112 
113  virtual void setWeaponStatus(const int weaponStatus);
114  virtual const int weaponStatus() const;
115 
117  virtual DtString weaponStatusString() const;
118 
121  virtual const DtString& statusReason(DtWeaponStatus status) const;
122  virtual void setStatusReason(DtWeaponStatus status, const DtString& reason);
123 
127  virtual void addWeaponStatus(const DtWeaponStatus weaponStatus);
128 
133  virtual void removeWeaponStatus(const DtWeaponStatus weaponStatus);
135 
137 
138  virtual void setIsInFiringCycle(const bool);
139  virtual bool isInFiringCycle()const;
141 
143 
144  virtual void setDesiredAmmunition(const std::list<DtEntityType>& list);
145  virtual const std::list<DtEntityType>& desiredAmmunition() const;
146  virtual std::list<DtEntityType>& desiredAmmunition();
148 
159  virtual void createMountPartList(const DtArtPartType partType);
161  virtual const std::list<DtArtPartType>& mountPartList() const;
163 
166  virtual void setSystemTurretNumber(const DtArtPartType num);
167  virtual DtArtPartType systemTurretNumber()const;
169 
174  virtual std::set<DtString>& requiredTokens();
175  virtual void setRequiredTokens(const std::set<DtString>& tokens);
177 
180  virtual void setControlExternalTurret(bool c);
181  virtual bool controlExternalTurret()const;
183 
184 protected:
187 
190 
195 
199 
201 
204 
209 
212  std::map<int, DtString> myStatusReasons;
213 
219  std::list<DtEntityType> myDesiredAmmunition;
220 
230  std::list<DtArtPartType> myMountPartList;
231 
234  DtArtPartType mySystemTurretNumber;
235 
241 
247  std::set<DtString> myRequiredTokens;
248 };
std::set< DtString > myRequiredTokens
List of resources required to operate the weapon; these are tokens that are reserved when the weapon ...
Definition: baseWeaponComponentInterface.h:247
DtRwBoolean myIsExplicitlyTasked
Tracks whether the weapon system has been explicitly tasked as opposed to a target being automaticall...
Definition: baseWeaponComponentInterface.h:198
std::map< int, DtString > myStatusReasons
Human-readable reasons supplementing myWeaponStatus, keyed by status bit. Not checkpointed – reset ea...
Definition: baseWeaponComponentInterface.h:212
DtRwBoolean myControlExternalTurret
Indicates that this weapon is controlling parent parts outside of the system to turn the gun...
Definition: baseWeaponComponentInterface.h:240
DtRwInt myRoundsFiredUponTarget
Tracks rounds fired upon current target.
Definition: baseWeaponComponentInterface.h:186
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
Definition: readerWriterRegistry.h:39
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
DtArtPartType mySystemTurretNumber
The articulated part corresponding to the turret in this gun system (as opposed to an ancestor part)...
Definition: baseWeaponComponentInterface.h:234
Description: Readable, Writable int.
Definition: rwInt.h:25
virtual DtVrfProcessStateRepository * clone(const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=0) const =0
DtRwInt myWeaponStatus
Current status of the weapon, is it able to fire or not. This value is a bit field composed of the va...
Definition: baseWeaponComponentInterface.h:208
std::list< DtArtPartType > myMountPartList
A list of articulated parts to which this weapon is attached. That is, its parent part...
Definition: baseWeaponComponentInterface.h:230
DtWeaponStatus
The status items below are used as bit fields. To set a state, OR the enumerated value into the weapo...
Definition: baseWeaponComponentInterface.h:36
DtRwBoolean myAllowExplicitTasking
Definition: baseWeaponComponentInterface.h:200
std::list< DtEntityType > myDesiredAmmunition
List of the available munition resources. This is not written out since it gets updated from the syst...
Definition: baseWeaponComponentInterface.h:219
DtRwString myDisplayName
Name to be used in the gui to represent this weapon.
Definition: baseWeaponComponentInterface.h:203
Class DtVrfProcessStateRepository: Abstract base class for all process state repositories. Process state repositories represent (potentially) shared, savable information for one or more components functioning together to achieve some process or set of processes; such as aiming and firing a weapon; moving an object; or just waiting a specified amount of time.
Definition: vrfProcessStateRepository.h:45
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
Abstract base class for all psrs that will serve as an interface between a controlling component on t...
Definition: baseWeaponComponentInterface.h:30
DtRwBoolean myIsInFiringCycle
Indicates that the weapon is in its firing cycle, which may mean is still firing a burst...
Definition: baseWeaponComponentInterface.h:194
File: rwVector.h.
const DtVrfProcessStateRepository & operator=(const DtVrfProcessStateRepository &orig)
A locally simulated VRF object.
Definition: localObject.h:98
DtRwInt myTotalRoundsToFireUponTarget
Tracks total rounds to fire upon current target.
Definition: baseWeaponComponentInterface.h:189

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)