![]() |
VR-Forces 4.0.4 Class Documentation
|
End User Description: This controller handles DtLaunchExpendableResourceTask tasks. More...

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 | |
| DtLaunchExpendableResourceController & | operator= (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 DtMunitionResource * | lookupExpendableResource (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 DtSimComponent * | creator (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 () |
| DtVrfObject * | createResourceObject (const DtObjectType &objType) |
| Creates the desired resource of object type objType. Returns the created vrfobject. | |
Protected Attributes | |
| const DtLaunchExpendableResourceControllerDescriptor * | myDesc |
| DtLaunchExpendableResourcePSR * | myProcessState |
| 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 |
| DtLaunchExpendableResourceTask * | myAutoLaunchTask |
| DtManagedObjectListConstPtr | myAutoDetectObjectsList |
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
| DtLaunchExpendableResourceController::DtLaunchExpendableResourceController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = NULL, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
constructor
| virtual DtLaunchExpendableResourceController::~DtLaunchExpendableResourceController | ( | ) | [virtual] |
destructor
| DtLaunchExpendableResourceController::DtLaunchExpendableResourceController | ( | const DtLaunchExpendableResourceController & | orig | ) |
copy constructor
| DtLaunchExpendableResourceController& DtLaunchExpendableResourceController::operator= | ( | const DtLaunchExpendableResourceController & | orig | ) |
assignment operator
| virtual DtString DtLaunchExpendableResourceController::type | ( | ) | const [virtual] |
This returns the string DtLaunchExpendableResourceControllerType, used to uniquely identify the type of component.
Implements DtTaskControllerComponent.
| virtual void DtLaunchExpendableResourceController::registerTaskMsgCallbacks | ( | ) | [virtual] |
Register a callback for task notification.
Reimplemented from DtTaskControllerComponent.
| static void DtLaunchExpendableResourceController::launchExpendableResourceTaskCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
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] |
| virtual void DtLaunchExpendableResourceController::processLaunchExpendableResourceTask | ( | DtSimMessage * | msg | ) | [virtual] |
Called by LaunchExpendableResourceTaskCallback() when a new DtLaunchExpendableResourceTask message is received.
| virtual void DtLaunchExpendableResourceController::processSetAutoLaunchEnabled | ( | DtSimMessage * | msg | ) | [virtual] |
Called by setAutoLaunchEnabledCallback, will enable or disable the autolaunch feature of this controller.
| virtual bool DtLaunchExpendableResourceController::init | ( | ) | [virtual] |
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.
| virtual DtMunitionResource* DtLaunchExpendableResourceController::lookupExpendableResource | ( | const DtString & | resourceName | ) | [virtual] |
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
| virtual bool DtLaunchExpendableResourceController::launchExpendableResources | ( | int | numberToFire | ) | [virtual] |
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.
| virtual bool DtLaunchExpendableResourceController::autoLaunchTriggered | ( | ) | [protected, virtual] |
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] |
| virtual void DtLaunchExpendableResourceController::setupAutoLaunchTriggerList | ( | ) | [protected, virtual] |
| virtual void DtLaunchExpendableResourceController::setUpAutoLaunchTaskFromDescriptor | ( | ) | [protected, virtual] |
| DtVrfObject* DtLaunchExpendableResourceController::createResourceObject | ( | const DtObjectType & | objType | ) | [protected] |
Creates the desired resource of object type objType. Returns the created vrfobject.
const DtLaunchExpendableResourceControllerDescriptor* DtLaunchExpendableResourceController::myDesc [protected] |
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.
double DtLaunchExpendableResourceController::myTimeInterval [protected] |
int DtLaunchExpendableResourceController::myNumberPerInterval [protected] |
DtManagedObjectListConstPtr DtLaunchExpendableResourceController::myAutoDetectObjectsList [protected] |