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

Public Types

typedef std::map< DtString,
DtWeaponInfoInterface * > 
WeaponInterfaceMap
 

Public Member Functions

 DtWeaponInfoList (DtLocalObject *localObject)
 
virtual ~DtWeaponInfoList ()
 
virtual bool init ()
 
virtual bool addWeaponInfo (const DtString &requestedId, DtWeaponInfoInterface *weaponInfo)
 
virtual void removeWeaponInfo (DtWeaponInfoInterface *weaponInfo)
 
virtual const
DtWeaponInfoInterface
weaponInfo (const DtString &weaponId) const
 
virtual const WeaponInterfaceMapweaponInfos () const
 
virtual bool blockedByOtherWeapon (const DtString &weaponId, DtString &blockingWeaponId) const
 
virtual bool weaponsConflict (const DtString &weapon1Id, const DtString &weapon2Id) const
 
virtual DtString weaponIdFromOldWeaponString (const DtString &pre51WeaponString) const
 

Protected Member Functions

virtual DtWeaponSystemType lookupWeaponType (std::list< DtSimTaskMessageType > &fireTaskTypes)
 
virtual bool tokenConflict (const DtWeaponInfoInterface *weapon1, const DtWeaponInfoInterface *weapon2) const
 
virtual bool artPartConflict (const DtWeaponInfoInterface *weapon1, const DtWeaponInfoInterface *weapon2) const
 

Protected Attributes

WeaponInterfaceMap myWeaponInfos
 
DtLocalObjectmyLocalObject
 
virtual void processWeaponListRequest (const DtVrfObjectMessage *msg)
 
static void weaponListRequestCallback (const DtVrfObjectMessage *msg, void *usr)
 

Member Typedef Documentation

Constructor & Destructor Documentation

DtWeaponInfoList::DtWeaponInfoList ( DtLocalObject localObject)
virtual DtWeaponInfoList::~DtWeaponInfoList ( )
virtual

Member Function Documentation

virtual bool DtWeaponInfoList::init ( )
virtual

Initialization - must be called before any other member functions are called Registers message callsbacks.

virtual bool DtWeaponInfoList::addWeaponInfo ( const DtString requestedId,
DtWeaponInfoInterface weaponInfo 
)
virtual

Adds a new weapon info. This should only be called by weapon controllers to add information about themselves.

Parameters
reqestedIdmust not already exist in the weapon info list. If it does, this will not be added.
Returns
True if it was successfully added.
virtual void DtWeaponInfoList::removeWeaponInfo ( DtWeaponInfoInterface weaponInfo)
virtual

Removes a previously added weapon interface.

virtual const DtWeaponInfoInterface* DtWeaponInfoList::weaponInfo ( const DtString weaponId) const
virtual
virtual const WeaponInterfaceMap& DtWeaponInfoList::weaponInfos ( ) const
virtual
virtual bool DtWeaponInfoList::blockedByOtherWeapon ( const DtString weaponId,
DtString blockingWeaponId 
) const
virtual

Checks for dependencies (based on art parts and tokens) between weaponId and other weapons in this list. If any are found, returns true, and returns the blocking weapon ID. This only returns true if the blocking weapon is currently busy and of higher priority.

virtual bool DtWeaponInfoList::weaponsConflict ( const DtString weapon1Id,
const DtString weapon2Id 
) const
virtual
Returns
true of these two weapons would conflict if they were used at the same time (based on art parts and tokens). Does not check priorities or any current state of the weapon, such as the busy status.
virtual DtString DtWeaponInfoList::weaponIdFromOldWeaponString ( const DtString pre51WeaponString) const
virtual

Attempts to find the weapon ID that best matches the string that was used in earlier versions of VRF to identify weapons, which in most cases was the display name. This is used to help convert loaded tasks from older versions of VRF into VRF 5.1 and newer.

Note
If a correct weapon ID is passed here, that will be detected and returned.
static void DtWeaponInfoList::weaponListRequestCallback ( const DtVrfObjectMessage msg,
void *  usr 
)
static

Responds to weapon list requests with list of weapon names associated with this entity.

virtual void DtWeaponInfoList::processWeaponListRequest ( const DtVrfObjectMessage msg)
virtual

Responds to weapon list requests with list of weapon names associated with this entity.

virtual DtWeaponSystemType DtWeaponInfoList::lookupWeaponType ( std::list< DtSimTaskMessageType > &  fireTaskTypes)
protectedvirtual

Lookup the DtWeaponSystemType based on the DtSimTaskMessageType Used for pre VRF-5.1 scenarios - should be deprecated.

virtual bool DtWeaponInfoList::tokenConflict ( const DtWeaponInfoInterface weapon1,
const DtWeaponInfoInterface weapon2 
) const
protectedvirtual
virtual bool DtWeaponInfoList::artPartConflict ( const DtWeaponInfoInterface weapon1,
const DtWeaponInfoInterface weapon2 
) const
protectedvirtual

Member Data Documentation

WeaponInterfaceMap DtWeaponInfoList::myWeaponInfos
protected
DtLocalObject* DtWeaponInfoList::myLocalObject
protected

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

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)