VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtLaunchExpendableResourceController Class Reference

End User Description: This controller handles DtLaunchExpendableResourceTask tasks. More...

Inheritance diagram for DtLaunchExpendableResourceController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtLaunchExpendableResourceController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=NULL, DtReaderWriterRegistry *parentRegistry=0)
 constructor
virtual ~DtLaunchExpendableResourceController ()
 destructor
 DtLaunchExpendableResourceController (const DtLaunchExpendableResourceController &orig)
 copy constructor
DtLaunchExpendableResourceControlleroperator= (const DtLaunchExpendableResourceController &orig)
 assignment operator
virtual DtString type () const
 This returns the string DtLaunchExpendableResourceControllerType, used to uniquely identify the type of component.
virtual void registerTaskMsgCallbacks ()
 Register a callback for task notification.
virtual void processLaunchExpendableResourceTask (DtSimMessage *msg)
 Called by LaunchExpendableResourceTaskCallback() when a new DtLaunchExpendableResourceTask message is received.
virtual void processSetAutoLaunchEnabled (DtSimMessage *msg)
 Called by setAutoLaunchEnabledCallback, will enable or disable the autolaunch feature of this controller.
virtual bool init ()
 Calculates myPoints, myArcRange from the descriptor parameters and stores them for use when the ExpendableResource is launched.
virtual void tick ()
 Checks if the desired interval of time between firing of the resources has passed.
virtual void taskComplete (bool success=true)
 Override parent class so we can clean out auto launched subtasks properly.
virtual DtMunitionResourcelookupExpendableResource (const DtString &resourceName)
 Look up the desired resource to launch.
virtual bool launchExpendableResources (int numberToFire)
 Launch desired number of resources.

Static Public Member Functions

static void launchExpendableResourceTaskCallback (DtSimMessage *msg, void *usr)
 Callback function (registered in registerTaskMsgCallbacks()) for DtLaunchExpendableResource task messages.
static void setAutoLaunchEnabledCallback (DtSimMessage *msg, void *usr)
static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry)
 This is called by the factory.

Protected Member Functions

virtual bool createPSR ()
 Called by init to create the process state repository.
virtual bool autoLaunchTriggered ()
 Evaluates if the entity should automatically launch its resources.
virtual DtString selectResourceForAutoLaunch (const DtObjectType &missileType)
virtual void setupAutoLaunchTriggerList ()
virtual void setUpAutoLaunchTaskFromDescriptor ()
DtVrfObjectcreateResourceObject (const DtObjectType &objType)
 Creates the desired resource of object type objType. Returns the created vrfobject.

Protected Attributes

const
DtLaunchExpendableResourceControllerDescriptor
myDesc
DtLaunchExpendableResourcePSRmyProcessState
 Saved out in the Order of Battle file(.oob).This will save out how many resources we have left to fire.
bool myFirstTick
 Used to intialize our vars.
double myTimeInterval
DtString myResourceName
int myNumberPerInterval
DtLaunchExpendableResourceTaskmyAutoLaunchTask
DtManagedObjectListConstPtr myAutoDetectObjectsList

Detailed Description

End User Description: This controller handles DtLaunchExpendableResourceTask tasks.

When it receives this task, the entity will check if the resource is available and if so will launch it with desired intial velocity specified in the descriptor. Uses Descriptor Type: DtLaunchExpendableResourceControllerDescriptor


Constructor & Destructor Documentation

constructor

destructor

copy constructor


Member Function Documentation

DtLaunchExpendableResourceController& DtLaunchExpendableResourceController::operator= ( const DtLaunchExpendableResourceController orig)

assignment operator

This returns the string DtLaunchExpendableResourceControllerType, used to uniquely identify the type of component.

Implements DtTaskControllerComponent.

Register a callback for task notification.

Reimplemented from DtTaskControllerComponent.

Callback function (registered in registerTaskMsgCallbacks()) for DtLaunchExpendableResource task messages.

Calls processLaunchExpendableResourceTask() to actually handle the task.

static void DtLaunchExpendableResourceController::setAutoLaunchEnabledCallback ( DtSimMessage msg,
void *  usr 
) [static]

Called by LaunchExpendableResourceTaskCallback() when a new DtLaunchExpendableResourceTask message is received.

Called by setAutoLaunchEnabledCallback, will enable or disable the autolaunch feature of this controller.

Calculates myPoints, myArcRange from the descriptor parameters and stores them for use when the ExpendableResource is launched.

Reimplemented from DtControllerComponent.

virtual void DtLaunchExpendableResourceController::tick ( ) [virtual]

Checks if the desired interval of time between firing of the resources has passed.

if so it will call launchExpendableResources and fire the next batch of resources

Reimplemented from DtSimComponent.

virtual void DtLaunchExpendableResourceController::taskComplete ( bool  success = true) [virtual]

Override parent class so we can clean out auto launched subtasks properly.

Reimplemented from DtSingleTaskControllerComponent.

static DtSimComponent* DtLaunchExpendableResourceController::creator ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc,
DtReaderWriterRegistry parentRegistry 
) [static]

This is called by the factory.

Look up the desired resource to launch.

If found returns it. For this controller we use munition resources because they store the entity type of the resource as well as the amount of the resource. We use this in the launchExp

Launch desired number of resources.

Looks up the resource name from the task via the above function. Next it creates the desired number of resource objects and depletes the resource and updates the process state's number left to fire. If there are not enough resources to launch this interval launch whatever remains. If there are no resources to launch or the resource entity could not be created this function will return false;

virtual bool DtLaunchExpendableResourceController::createPSR ( ) [protected, virtual]

Called by init to create the process state repository.

Evaluates if the entity should automatically launch its resources.

Default is to check if any missiles are with auto launch range of the entity. If so the entity is in danger and it will launch its default task of counter measures. Will check the missile type to determine whether to launch chaff or flare.

virtual DtString DtLaunchExpendableResourceController::selectResourceForAutoLaunch ( const DtObjectType missileType) [protected, virtual]

Creates the desired resource of object type objType. Returns the created vrfobject.


Member Data Documentation

Saved out in the Order of Battle file(.oob).This will save out how many resources we have left to fire.

Used to intialize our vars.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)