VR-Forces 5.0.2 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 
12 #include <readerWriter/rwString.h>
13 #include <readerWriter/rwBoolean.h>
14 #include <readerWriter/rwReal.h>
15 #include <readerWriter/rwInt.h>
16 #include "readerWriter/rwVector.h"
17 #include "vlpi/disEnums.h"
18 
20 #include <list>
21 #include <set>
22 
23 
29 {
30 public:
35  {
36  DT_OK_TO_FIRE = 0,
37  DT_WEAPON_DISABLED = 1,
38  DT_NO_AMMUNITION_FOR_TARGET = 2,
39  DT_CANNOT_ACQUIRE_TARGET = 4,
40  DT_SUPPRESSED = 8,
41  DT_OUT_OF_AMMUNITION_FOR_WEAPON = 16,
42  DT_WEAPON_BUSY = 32
43  };
44 
45 private:
48 
49 public:
50 
51  //constructor
53  const DtString& rwName = DtString::nullString(),
54  DtReaderWriterRegistry* parentRegistry = 0);
55 
56  //copy constructor
58  const DtString& rwName = DtString::nullString(),
59  DtReaderWriterRegistry* parentRegistry = 0);
60 
61  //assignment operator
63  const DtBaseWeaponComponentInterface& orig);
64 
65  //destructor
67 
68  //returns a copy of the PSR
70  const DtString& rwName = DtString::nullString(),
71  DtReaderWriterRegistry* parentRegistry = 0) const = 0;
72 
75  virtual void updateRegionEvaluator() = 0;
76 
81  virtual bool locationWithinRegion(const DtVector& localLocation) const = 0;
82 
84  virtual void setRoundsFiredUponTarget(const int& roundsFired);
85  virtual const int roundsFiredUponTarget() const;
86 
88  virtual void setTotalRoundsToFireUponTarget(const int& totalRoundsToFire);
89  virtual const int totalRoundsToFireUponTarget() const;
90 
92 
93  virtual void setIsExplicitlyTasked(const bool& explicitlyTasked);
94  virtual const bool isExplicitlyTasked() const;
96 
98 
99  virtual void setAllowExplicitTasking(const bool& includeInDialogs);
100  virtual const bool allowExplicitTasking() const;
102 
104 
105  virtual void setDisplayName(const DtString& displayName);
106  virtual const DtString& displayName() const;
108 
110 
111  virtual void setWeaponStatus(const int weaponStatus);
112  virtual const int weaponStatus() const;
113 
115  virtual DtString weaponStatusString() const;
116 
120  virtual void addWeaponStatus(const DtWeaponStatus weaponStatus);
121 
126  virtual void removeWeaponStatus(const DtWeaponStatus weaponStatus);
128 
130 
131  virtual void setIsInFiringCycle(const bool);
132  virtual bool isInFiringCycle()const;
134 
136 
137  virtual void setResourceList(const std::list<DtString>& list);
138  virtual const std::list<DtString>& resourceList() const;
139  virtual std::list<DtString>& resourceList();
141 
147  virtual void setPriority(const int priority);
148  virtual int priority() const;
150 
161  virtual void createMountPartList(const DtArtPartType partType);
163  virtual const std::list<DtArtPartType>& mountPartList() const;
165 
168  virtual void setSystemTurretNumber(const DtArtPartType num);
169  virtual DtArtPartType systemTurretNumber()const;
171 
176  virtual std::set<DtString>& requiredTokens();
177  virtual void setRequiredTokens(const std::set<DtString>& tokens);
179 
182  virtual void setTreatSelectedAsTasked(bool t);
183  bool treatSelectedAsTasked()const;
185 
188  virtual void setControlExternalTurret(bool c);
189  virtual bool controlExternalTurret()const;
191 
192 protected:
195 
198 
203 
207 
209 
212 
215 
221  std::list<DtString> myResources;
222 
228 
238  std::list<DtArtPartType> myMountPartList;
239 
242  DtArtPartType mySystemTurretNumber;
243 
249 
255  std::set<DtString> myRequiredTokens;
256 
264 };
std::set< DtString > myRequiredTokens
List of resources required to operate the weapon; these are tokens that are reserved when the weapon ...
Definition: baseWeaponComponentInterface.h:255
DtRwBoolean myIsExplicitlyTasked
Tracks whether the weapon system has been explicitly tasked as opposed to a target being automaticall...
Definition: baseWeaponComponentInterface.h:206
DtRwBoolean myControlExternalTurret
Indicates that this weapon is controlling parent parts outside of the system to turn the gun...
Definition: baseWeaponComponentInterface.h:248
DtRwInt myRoundsFiredUponTarget
Tracks rounds fired upon current target.
Definition: baseWeaponComponentInterface.h:194
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
Definition: readerWriterRegistry.h:39
DtRwBoolean myTreatSelectedAsTasked
Indicates that when a target is auto-selected for this gun, vs. set in a fire-at-target task...
Definition: baseWeaponComponentInterface.h:263
DtRwInt myPriority
A priority value to determine which weapon on an entity should be used if both have targets...
Definition: baseWeaponComponentInterface.h:227
#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:242
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.
Definition: baseWeaponComponentInterface.h:214
std::list< DtArtPartType > myMountPartList
A list of articulated parts to which this weapon is attached. That is, its parent part...
Definition: baseWeaponComponentInterface.h:238
std::list< DtString > myResources
List of the available munition resources. This is not written out since it gets updated from the syst...
Definition: baseWeaponComponentInterface.h:221
DtWeaponStatus
The status items below are used as bit fields. To set a state, OR the enumerated value into the weapo...
Definition: baseWeaponComponentInterface.h:34
DtRwBoolean myAllowExplicitTasking
Definition: baseWeaponComponentInterface.h:208
DtRwString myDisplayName
Name to be used in the gui to represent this weapon.
Definition: baseWeaponComponentInterface.h:211
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:28
DtRwBoolean myIsInFiringCycle
Indicates that the weapon is in its firing cycle, which may mean is still firing a burst...
Definition: baseWeaponComponentInterface.h:202
File: rwVector.h.
const DtVrfProcessStateRepository & operator=(const DtVrfProcessStateRepository &orig)
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
DtRwInt myTotalRoundsToFireUponTarget
Tracks total rounds to fire upon current target.
Definition: baseWeaponComponentInterface.h:197

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)