VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
genericWeaponInfo.h
Go to the documentation of this file.
1 #pragma once
2 
5 #include <functional>
6 #include "vrfmsgs/messageTypes.h"
7 #include "boost/smart_ptr.hpp"
9 
12 class Coordinate_System;
13 class DtLocalObject;
14 
18 {
19 public:
20  typedef std::function<DtWeaponInfoInterface::TargetApplicability(const DtEntityType&)> TargetApplicabilityFcn;
21  typedef std::function<DtSimTask*(const DtRwLocationReference&)> FireTaskFcn;
22  typedef std::function<bool(const DtVector&)> TargetRegionFcn;
23 
25  virtual ~DtGenericWeaponInfo();
26 
27  virtual DtString displayName() const override;
28  virtual void setDisplayName(const DtString& name);
29 
30  virtual DtU32 status() const override;
32  virtual void setStatus(DtU32 s);
34  virtual void addStatus(WeaponStatus s);
36  virtual void removeStatus(WeaponStatus s);
37 
38  virtual std::list<DtSimTaskMessageType> fireTaskTypes() const override;
40  virtual void addFireTaskType(DtSimTaskMessageType taskType);
42  virtual void addFireTaskTypes(const DtRwNLengthStringVector& taskList);
43 
44  virtual DtSimTask* createFireTask(const DtRwLocationReference& location) const override;
45  virtual void setFireTaskFcn(FireTaskFcn fcn);
46 
47  virtual bool withinTargetRegion(const DtVector& localPosition) const override;
48  virtual void setTargetRegionFcn(TargetRegionFcn fcn);
49 
50  virtual TargetApplicability targetApplicability(const DtEntityType& type) const override;
51  virtual void setTargetApplicabilityFcn(TargetApplicabilityFcn fcn);
52 
53 
56  virtual const std::list<DtString>& resourceList() const override;
57  virtual void setResourceList(const std::list<DtString>& list);
58 
63  virtual const std::list<DtArtPartType>& mountPartList() const override;
64  virtual void createMountPartList(const DtArtPartType partType);
65 
68  virtual DtArtPartType systemTurretNumber() const override;
69  virtual void setSystemTurretNumber(const DtArtPartType num);
70 
75  virtual bool controlExternalTurret() const override;
76  virtual void setControlExternalTurret(bool c);
77 
83  virtual const std::set<DtString>& requiredTokens() const override;
84  virtual void setRequiredTokens(const std::set<DtString>& tokens);
85 
86  virtual bool autonomousFire() const override;
87  virtual void setAutonomousFire(bool v);
88  virtual const std::list<DtEntityType>& autonomousTargetTypes() const override;
89  virtual void setAutonomousTargetTypes(const std::list<DtEntityType>& targetTypes);
90 
91  virtual const DtRwProperties* weaponProperties() const override;
94  virtual void setWeaponProperties(const DtRwProperties* props);
95 
96  virtual int priority() const override;
97  virtual void setPriority(int p);
98 
99 protected:
101  DtU32 myStatus;
102  std::list<DtSimTaskMessageType> myFireTaskTypes;
103  std::list<DtString> myResourceList;
104  std::list<DtArtPartType> myMountPartList;
105  DtArtPartType myTurretNumber;
107  std::set<DtString> myRequiredTokens;
109  std::list<DtEntityType> myAutonomousTargetTypes;
112 
116 };
117 
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
std::function< bool(const DtVector &)> TargetRegionFcn
Definition: genericWeaponInfo.h:22
A reader-writer type which contains a single dynamically typed subclass of DtRwSpatialFilter. The container itself is also a subclass of DtRwSpatialFilter, so it can hold instances of itself.
Definition: rwSpatialFilterContainer.h:22
DtString myWeaponName
Definition: genericWeaponInfo.h:100
DtRwNLengthStringVector is a named, readable/writable vector of strings of arbitrary length...
Definition: rwNLengthStringVector.h:28
virtual DtString displayName() const =0
const std::map< int, QString > targetTypes
Definition: targetConfigurationDialog.h:40
virtual bool autonomousFire() const =0
Indicates whether on not this weapon should be used by VR-Forces autonomous fire controllers.
std::function< DtWeaponInfoInterface::TargetApplicability(const DtEntityType &)> TargetApplicabilityFcn
Definition: genericWeaponInfo.h:20
DtU32 myStatus
Definition: genericWeaponInfo.h:101
Holds a position of some form. May be an absolute position, or a reference to another object...
Definition: rwLocationReference.h:25
virtual bool withinTargetRegion(const DtVector &localPosition) const =0
int myPriority
Definition: genericWeaponInfo.h:111
std::list< DtEntityType > myAutonomousTargetTypes
Definition: genericWeaponInfo.h:109
virtual DtSimTask * createFireTask(const DtRwLocationReference &location) const =0
bool myAutonomousFire
Definition: genericWeaponInfo.h:108
virtual TargetApplicability targetApplicability(const DtEntityType &type) const =0
virtual const std::list< DtArtPartType > & mountPartList() const =0
A list of articulated parts to which this weapon is attached. That is, its parent part...
WeaponStatus
Definition: weaponInfoInterface.h:30
std::function< DtSimTask *(const DtRwLocationReference &)> FireTaskFcn
Definition: genericWeaponInfo.h:21
TargetApplicabilityFcn myTargetApplicabilityFcn
Definition: genericWeaponInfo.h:113
Definition: coordSystem.h:54
FireTaskFcn myFireTaskFcn
Definition: genericWeaponInfo.h:114
virtual DtArtPartType systemTurretNumber() const =0
The articulated part corresponding to the turret in this gun system (as opposed to an ancestor part)...
An implementation of DtWeaponInforInterface that allows for flexible registering of functions from ot...
Definition: genericWeaponInfo.h:17
std::list< DtArtPartType > myMountPartList
Definition: genericWeaponInfo.h:104
virtual int priority() const =0
Priority of this weapon. Used to compare to other weapons on this platform if there are conflicts...
An abstract base class for all evaluators of spatial filters. The evaluation of spatial filters is sp...
Definition: spatialFilterEvaluator.h:30
DtArtPartType myTurretNumber
Definition: genericWeaponInfo.h:105
virtual const std::list< DtEntityType > & autonomousTargetTypes() const =0
Returns the entity types which this weapon would be used against for autonomous fire.
TargetApplicability
Definition: weaponInfoInterface.h:21
std::set< DtString > myRequiredTokens
Definition: genericWeaponInfo.h:107
virtual const std::set< DtString > & requiredTokens() const =0
List of resources required to operate the weapon; these are tokens that are reserved when the weapon ...
virtual std::list< DtSimTaskMessageType > fireTaskTypes() const
Task types that can be used to fire this weapon.
std::list< DtSimTaskMessageType > myFireTaskTypes
Definition: genericWeaponInfo.h:102
virtual const DtRwProperties * weaponProperties() const =0
DtSimTask is an abstract base class from which real tasks can derive. It manages the read/write capab...
Definition: simTask.h:30
virtual bool controlExternalTurret() const =0
Indicates that this weapon is controlling parent parts outside of the system to turn the gun...
bool myControlExternalTurret
Definition: genericWeaponInfo.h:106
const DtRwProperties * myProperties
Definition: genericWeaponInfo.h:110
A list of properties. A DtPropertyInterface object that is a specialized version of DtRwVariableBindi...
Definition: rwProperties.h:126
virtual const std::list< DtString > & resourceList() const =0
List of the available munition resources. Only resources with non zero amounts are on this list...
Abstract interface class for Weapon Information. This is used by DtWeaponInterfaceList. All code that is accessing information about weapons will have access to this base class only, and only be able to read the data. Weapon controllers will have derived versions that implement key functions for their specific weapon.
Definition: weaponInfoInterface.h:18
TargetRegionFcn myTargetRegionFcn
Definition: genericWeaponInfo.h:115
std::list< DtString > myResourceList
Definition: genericWeaponInfo.h:103
virtual DtU32 status() const =0
Weapon status bitfield. 0 indicates the weapon is in the &quot;ready&quot; state. For any non-0 value...
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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)