VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DtWeaponListCommandSpecParamBuilder Class Reference

DtWeaponListCommandSpecParamBuilder.

Asynchronous DtCommandSpecParamBuilder that populates the Choices array for a weapon-list parameter. It requests weapon system data from the DtRemoteControlWeaponListRequestor and signals readiness once the data has been received (or immediately when it is already cached). Supports merging munition options into the same parameter when the TypeModifiers indicate to do so.

Inheritance diagram for DtWeaponListCommandSpecParamBuilder:
Inheritance graph
[legend]

Public Member Functions

 DtWeaponListCommandSpecParamBuilder (const Json::Value &staticParams, const std::string &entityName, DtScenarioManager &scnMgr, const Json::Value &typeModifiers, bool displayWeapons=true, bool displayMunitions=false)
 
 ~DtWeaponListCommandSpecParamBuilder ()
 
- Public Member Functions inherited from DtCommandSpecParamBuilder
 DtCommandSpecParamBuilder ()=default
 
virtual ~DtCommandSpecParamBuilder ()=default
 
virtual bool isEntitySpecific () const
 

Protected Member Functions

bool addOptions ()
 
bool hasValidResult () const
 
bool addWeaponOptions ()
 
bool addMunitionAsChoice ()
 
bool addMunitionAsCollection ()
 
void requestData ()
 
void parseTypeModifiers ()
 
virtual void slot_receivedWeaponList (const DtUUID &entity)
 
virtual bool isReady () const override
 
virtual Json::Value result () const override
 
virtual bool includeWeapon (const WeaponSystem &weapon) const
 
virtual bool getTypeModifier (std::string name, std::string &result) const
 

Private Attributes

Json::Value myResult
 
DtUUID myEntityUuid
 
std::atomic< bool > myReady
 
DtRemoteControlWeaponListRequestor & myWeaponListRequestor
 
boost::signals2::connection myConnection
 
Json::Value myTypeModifiers
 
bool myDisplayWeapons = true
 
bool myDisplayMunitions = true
 
DtScenarioManager & myScenarioManager
 

Constructor & Destructor Documentation

DtWeaponListCommandSpecParamBuilder::DtWeaponListCommandSpecParamBuilder ( const Json::Value &  staticParams,
const std::string &  entityName,
DtScenarioManager &  scnMgr,
const Json::Value &  typeModifiers,
bool  displayWeapons = true,
bool  displayMunitions = false 
)
explicit
DtWeaponListCommandSpecParamBuilder::~DtWeaponListCommandSpecParamBuilder ( )

Member Function Documentation

bool DtWeaponListCommandSpecParamBuilder::addOptions ( )
protected

adds either weapons or munitions, depending on what type of request this handles

bool DtWeaponListCommandSpecParamBuilder::hasValidResult ( ) const
protected

returns true if the result has been populated with choices or collections, false if data was not yet available.

bool DtWeaponListCommandSpecParamBuilder::addWeaponOptions ( )
protected

If the requestor has options for this entity, add them to the result. Returns true if choices were populated, false if data was not yet available.

bool DtWeaponListCommandSpecParamBuilder::addMunitionAsChoice ( )
protected

Returns true if the requestor has munition options for this entity, and adds them as a single choice into the json response.

bool DtWeaponListCommandSpecParamBuilder::addMunitionAsCollection ( )
protected

Returns true if the requestor has munition options for this entity, and adds them as a collection into the json response. Each weapon will list the desired/supported munition names.

void DtWeaponListCommandSpecParamBuilder::requestData ( )
protected
void DtWeaponListCommandSpecParamBuilder::parseTypeModifiers ( )
protected
virtual void DtWeaponListCommandSpecParamBuilder::slot_receivedWeaponList ( const DtUUID &  entity)
protectedvirtual
virtual bool DtWeaponListCommandSpecParamBuilder::isReady ( ) const
inlineoverrideprotectedvirtual

Returns true once result() can be safely called.

Implements DtCommandSpecParamBuilder.

References myReady.

virtual Json::Value DtWeaponListCommandSpecParamBuilder::result ( ) const
inlineoverrideprotectedvirtual

Returns the fully populated JSON descriptor for this parameter. Only valid after isReady() returns true.

Implements DtCommandSpecParamBuilder.

References myResult.

virtual bool DtWeaponListCommandSpecParamBuilder::includeWeapon ( const WeaponSystem &  weapon) const
protectedvirtual
virtual bool DtWeaponListCommandSpecParamBuilder::getTypeModifier ( std::string  name,
std::string &  result 
) const
protectedvirtual

Member Data Documentation

Json::Value DtWeaponListCommandSpecParamBuilder::myResult
private

Referenced by result().

DtUUID DtWeaponListCommandSpecParamBuilder::myEntityUuid
private
std::atomic<bool> DtWeaponListCommandSpecParamBuilder::myReady
private

Referenced by isReady().

DtRemoteControlWeaponListRequestor& DtWeaponListCommandSpecParamBuilder::myWeaponListRequestor
private
boost::signals2::connection DtWeaponListCommandSpecParamBuilder::myConnection
private
Json::Value DtWeaponListCommandSpecParamBuilder::myTypeModifiers
private
bool DtWeaponListCommandSpecParamBuilder::myDisplayWeapons = true
private
bool DtWeaponListCommandSpecParamBuilder::myDisplayMunitions = true
private
DtScenarioManager& DtWeaponListCommandSpecParamBuilder::myScenarioManager
private

The documentation for this class was generated from the following file:

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)