![]() |
VR-Forces Developer's Guide
|
An implementation of DtWeaponInforInterface that allows for flexible registering of functions from other classes to meet the API.

Public Types | |
| typedef std::function < DtWeaponInfoInterface::TargetApplicability(const DtEntityType &)> | TargetApplicabilityFcn |
| typedef std::function < DtSimTask *(const DtRwLocationReference &, const DtU8 hitZoneFunction, const DtEntityType &munitionType)> | FireTaskFcn |
| typedef std::function< bool(const DtVector &)> | TargetRegionFcn |
| typedef std::function< double()> | RangeFcn |
| typedef std::map< DtEntityType, DtString > | MunitionEvaluationReasons |
| typedef std::function< bool(const DtRwLocationReference &, DtEntityType &, MunitionEvaluationReasons &)> | BestMunitionForTargetFcn |
Public Types inherited from DtWeaponInfoInterface | |
| enum | WeaponStatus { WeaponStatus_Busy = 1, WeaponStatus_Disabled = 2, WeaponStatus_OutOfAmmo = 4, WeaponStatus_Suppressed = 8, WeaponStatus_Stowed = 16 } |
| using | TargetApplicability = DtTargetApplicability |
Public Member Functions | |
| DtGenericWeaponInfo () | |
| virtual | ~DtGenericWeaponInfo () override |
| virtual DtString | displayName () const override |
| virtual void | setDisplayName (const DtString &name) |
| virtual DtU32 | status () const override |
| virtual void | setStatus (DtU32 s) |
| virtual void | addStatus (WeaponStatus s) |
| virtual void | removeStatus (WeaponStatus s) |
| virtual std::list < DtSimTaskMessageType > | fireTaskTypes () const override |
| virtual void | addFireTaskType (DtSimTaskMessageType taskType) |
| virtual void | addFireTaskTypes (const DtRwNLengthStringVector &taskList) |
| virtual DtSimTask * | createFireTask (const DtRwLocationReference &location, const DtU8 hitZoneFunction) const override |
| virtual DtSimTask * | createFireTask (const DtRwLocationReference &location, const DtU8 hitZoneFunction, const DtEntityType &munitionType) const override |
| virtual void | setFireTaskFcn (FireTaskFcn fcn) |
| virtual bool | withinTargetRegion (const DtVector &localPosition) const override |
| virtual void | setTargetRegionFcn (TargetRegionFcn fcn) |
| virtual double | maximumRange () const override |
| virtual void | setMaximumRangeFcn (RangeFcn fcn) |
| virtual double | minimumRange () const override |
| virtual void | setMinimumRangeFcn (RangeFcn fcn) |
| virtual TargetApplicability | targetApplicability (const DtEntityType &type) const override |
| virtual void | setTargetApplicabilityFcn (TargetApplicabilityFcn fcn) |
| virtual bool | bestMunitionForTarget (const DtRwLocationReference &targetLocation, DtEntityType &chosenMunitionOut, MunitionEvaluationReasons &reasonsOut) const |
| virtual void | setBestMunitionForTargetFcn (BestMunitionForTargetFcn fcn) |
| virtual const std::list < DtEntityType > & | desiredAmmunition () const override |
| virtual void | setDesiredAmmunition (const std::list< DtEntityType > &list) |
| virtual const std::list < DtArtPartType > & | mountPartList () const override |
| void | setMountPartList (const std::list< DtArtPartType > &parts) |
| virtual DtArtPartType | systemTurretNumber () const override |
| virtual void | setSystemTurretNumber (const DtArtPartType num) |
| virtual bool | controlExternalTurret () const override |
| virtual void | setControlExternalTurret (bool c) |
| virtual const std::set < DtString > & | requiredTokens () const override |
| virtual void | setRequiredTokens (const std::set< DtString > &tokens) |
| virtual bool | autonomousFire () const override |
| virtual void | setAutonomousFire (bool v) |
| virtual const std::list < DtEntityType > & | autonomousTargetTypes () const override |
| virtual void | setAutonomousTargetTypes (const std::list< DtEntityType > &targetTypes) |
| virtual const DtRwProperties * | weaponProperties () const override |
| virtual void | setWeaponProperties (const DtRwProperties *props) |
Public Member Functions inherited from DtWeaponInfoInterface | |
| DtWeaponInfoInterface () | |
| virtual | ~DtWeaponInfoInterface ()=0 |
| virtual DtString | statusString () const |
| virtual bool | ready () const |
| virtual bool | hasStatus (WeaponStatus testStatus) const |
Protected Attributes | |
| DtString | myWeaponName |
| DtU32 | myStatus |
| std::list< DtSimTaskMessageType > | myFireTaskTypes |
| std::list< DtEntityType > | myDesiredAmmunition |
| std::list< DtArtPartType > | myMountPartList |
| DtArtPartType | myTurretNumber |
| bool | myControlExternalTurret |
| std::set< DtString > | myRequiredTokens |
| bool | myAutonomousFire |
| std::list< DtEntityType > | myAutonomousTargetTypes |
| const DtRwProperties * | myProperties |
| TargetApplicabilityFcn | myTargetApplicabilityFcn |
| FireTaskFcn | myFireTaskFcn |
| TargetRegionFcn | myTargetRegionFcn |
| RangeFcn | myMinimumRangeFcn |
| RangeFcn | myMaximumRangeFcn |
| BestMunitionForTargetFcn | myBestMunitionForTargetFcn |
Additional Inherited Members | |
Static Public Member Functions inherited from DtWeaponInfoInterface | |
| static std::string | targetApplicabilityString (TargetApplicability app) |
Static Public Attributes inherited from DtWeaponInfoInterface | |
| static constexpr TargetApplicability | TargetApplicability_Unspecified = DtTargetApplicability_Unspecified |
| static constexpr TargetApplicability | TargetApplicability_NotApplicable = DtTargetApplicability_NotApplicable |
| static constexpr TargetApplicability | TargetApplicability_Overkill = DtTargetApplicability_Overkill |
| static constexpr TargetApplicability | TargetApplicability_Applicable = DtTargetApplicability_Applicable |
| static constexpr TargetApplicability | TargetApplicability_Ideal = DtTargetApplicability_Ideal |
| typedef std::function<DtWeaponInfoInterface::TargetApplicability(const DtEntityType&)> DtGenericWeaponInfo::TargetApplicabilityFcn |
| typedef std::function<DtSimTask*(const DtRwLocationReference&, const DtU8 hitZoneFunction, const DtEntityType& munitionType)> DtGenericWeaponInfo::FireTaskFcn |
Builds a fire task for the given target. munitionType is the caller's preferred munition (typically the result of a prior bestMunitionForTarget() query); pass DtEntityType::nullType() when no preference is available. Weapon controllers whose task type does not carry an ammo field ignore this argument.
| typedef std::function<bool(const DtVector&)> DtGenericWeaponInfo::TargetRegionFcn |
TODO(DEPRECATED-TargetRegionFcn): retained only for indirect-fire / cruise-missile controllers until they migrate to canEngageTarget().
| typedef std::function<double()> DtGenericWeaponInfo::RangeFcn |
| typedef std::map<DtEntityType, DtString> DtGenericWeaponInfo::MunitionEvaluationReasons |
Maps each evaluated munition type to a human-readable reason string. Selected munition maps to "selected"; rejected munitions map to their rejection reason (e.g. "no stock", "OutOfRange", "NoSolution").
| typedef std::function<bool(const DtRwLocationReference&, DtEntityType&, MunitionEvaluationReasons&)> DtGenericWeaponInfo::BestMunitionForTargetFcn |
| DtGenericWeaponInfo::DtGenericWeaponInfo | ( | ) |
|
overridevirtual |
|
overridevirtual |
Implements DtWeaponInfoInterface.
|
virtual |
|
overridevirtual |
Weapon status bitfield. 0 indicates the weapon is in the "ready" state. For any non-0 value, the details of the status can be checked using the WeaponStatus bitfields on this return value.
Implements DtWeaponInfoInterface.
|
virtual |
Sets the entire status bitfield.
|
virtual |
Turns on a specific status bit in the status field.
|
virtual |
Turns off a specific status bit in the status field.
|
overridevirtual |
Task types that can be used to fire this weapon.
Reimplemented from DtWeaponInfoInterface.
|
virtual |
Adds a fire task to the list of fire task types.
|
virtual |
Convince function for adding multiple fire task types that are stored as strings in a DtRwNLengthStringVector.
|
overridevirtual |
Implements DtWeaponInfoInterface.
|
overridevirtual |
Overload allowing the caller to specify a preferred munition type (e.g. the result of bestMunitionForTarget()). Controllers whose task type does not carry an ammo field ignore munitionType.
Reimplemented from DtWeaponInfoInterface.
|
virtual |
|
overridevirtual |
TODO(DEPRECATED-TargetRegionFcn): use bestMunitionForTarget()/canEngageTarget().
Implements DtWeaponInfoInterface.
|
virtual |
TODO(DEPRECATED-TargetRegionFcn): new controllers must not call this; engageability is answered by the canEngageTarget chain installed on DtVrfTurretedBalGunPSR (see setCanEngageTargetFcn / setCanAcquireTargetFcn / setCanFaceTargetFcn). Retained for indirect-fire / cruise-missile.
|
overridevirtual |
Implements DtWeaponInfoInterface.
|
virtual |
|
overridevirtual |
Implements DtWeaponInfoInterface.
|
virtual |
|
overridevirtual |
Implements DtWeaponInfoInterface.
|
virtual |
|
virtual |
Location-aware ammo selection with the best munition that can ballistically reach targetLocation. Returns false if no suitable munition exists.
|
virtual |
|
overridevirtual |
List of the available munition resources. Only resources with non zero amounts are on this list.
Implements DtWeaponInfoInterface.
|
virtual |
|
overridevirtual |
A list of articulated parts to which this weapon is attached. That is, its parent part, that parent's part, etc. Used to determine when different weapons are dependent on the same part. The list contains articulated part type numbers.
Implements DtWeaponInfoInterface.
| void DtGenericWeaponInfo::setMountPartList | ( | const std::list< DtArtPartType > & | parts | ) |
|
overridevirtual |
The articulated part corresponding to the turret in this gun system (as opposed to an ancestor part).
Implements DtWeaponInfoInterface.
|
virtual |
|
overridevirtual |
Indicates that this weapon is controlling parent parts outside of the system to turn the gun. I.e., a tank MG is controlling the main turret in order to reach targets outside the normal slew range of the MG.
Implements DtWeaponInfoInterface.
|
virtual |
|
overridevirtual |
List of resources required to operate the weapon; these are tokens that are reserved when the weapon operates, but are not consumed. There is no token reservation system; other components just check to see if their tokens against this set to see if there is a conflict. These tokens may represent crew members, for example.
Implements DtWeaponInfoInterface.
|
virtual |
|
overridevirtual |
Indicates whether on not this weapon should be used by VR-Forces autonomous fire controllers.
Implements DtWeaponInfoInterface.
|
virtual |
|
overridevirtual |
Returns the entity types which this weapon would be used against for autonomous fire.
Implements DtWeaponInfoInterface.
|
virtual |
|
overridevirtual |
Implements DtWeaponInfoInterface.
|
virtual |
Set the properties pointer that will be returned to consumers of the weapon info. Note: This class does not assume ownership of this class.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |