VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
launchExpendableResourceController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
16 #include "vlutil/vlString.h"
17 
21 class DtMunitionResource;
22 
29 {
30 public:
33  DtSimulationServices * simManager, DtComponentDescriptor* desc = nullptr,
34  DtReaderWriterRegistry * parentRegistry = nullptr);
35 
38 
41 
44 
47  virtual const char* type() const override;
48 
50  virtual void registerTaskMsgCallbacks() override;
51 
52  static void setAutoLaunchEnabledCallback(DtSimMessage * msg, void * usr);
53 
54  static void launchCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
55 
56  virtual DtSimTaskStatePtr currentTaskState() const override;
57 
60  virtual void processSetAutoLaunchEnabled(DtSimMessage* msg);
61 
64  virtual bool init() override;
65 
68  virtual bool postAddComponentsInit() override;
69 
73  virtual void preFirstTickInit() override;
74 
77  virtual void tick() override;
78 
81  virtual AcceptLevel acceptTask(const DtTaskMessage& task) override;
82 
84  virtual void taskComplete(bool success = true) override;
85 
87  static DtSimComponent* creator(const DtString & name, DtLocalObject* owner,
88  DtSimulationServices * simManager, DtComponentDescriptor* desc,
89  DtReaderWriterRegistry * parentRegistry);
90 
93  virtual DtMunitionResource* lookupExpendableResource(const DtString & resourceName, int& quantity);
94 
100  virtual bool launchExpendableResources(int numberToFire, const DtString& resourceName);
101 
104  virtual void clearTask() override;
105 
106 protected:
107  virtual void processLaunch(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
108 
110  virtual bool createPSR();
111 
116  virtual bool autoLaunchTriggered();
117 
118  virtual DtString selectResourceForAutoLaunch(const DtObjectType & missileType);
119 
120  virtual void setupAutoLaunchTriggerList();
121  virtual void setUpAutoLaunchTaskFromDescriptor();
122 
124  virtual DtCreateObjectHandle createResourceObject(const DtObjectType & objType);
125 
126 protected:
128 
132 
135 
136 
139 };
140 
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
int myNumberPerInterval
Definition: launchExpendableResourceController.h:133
virtual bool postAddComponentsInit() override
Calls enableTaskTypes()
Handle returned from Create Object Service calls.
Definition: createObjectHandle.h:12
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual void registerTaskMsgCallbacks()
DtLaunchExpendableResourceTask represents a launching task where by the entity will launch the specif...
Definition: launchExpendableResourceTask.h:30
AcceptLevel
Levels that a task controller can accept a task it has registered for.
Definition: taskControllerComponent.h:55
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
DtLaunchExpendableResourceControllerDescriptor; descriptor for the DtLaunchExpendableResourceControll...
Definition: launchExpendableResourceControllerDescriptor.h:41
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
virtual void taskComplete(bool success=true)
If we are currently tasked, this will cause us to notify the entity that we're done and delete the ta...
DtLaunchExpendableResourcePSR * myProcessState
Saved out in the Order of Battle file(.oob).This will save out how many resources we have left to fir...
Definition: launchExpendableResourceController.h:131
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
DtManagedObjectListConstPtr myAutoDetectObjectsList
Definition: launchExpendableResourceController.h:137
virtual bool init() override
Calls setRadio()
DtLaunchExpendableResourceTask * myAutoLaunchTask
Definition: launchExpendableResourceController.h:134
const DtLaunchExpendableResourceControllerDescriptor * myDesc
Definition: launchExpendableResourceController.h:127
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
virtual DtSimTaskStatePtr currentTaskState() const
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.
Definition: launchExpendableResourceController.h:28
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:95
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:91
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtBoost::shared_ptr< const DtManagedObjectList > DtManagedObjectListConstPtr
Typedef for a shared pointer to a const DtOrgViewManagedObjectList. These lists are used within VR-Fo...
Definition: managedObjectList.h:35
virtual AcceptLevel acceptTask(const DtTaskMessage &task)
Called by the task manager when this controller is being considered to execute a task. Only tasks which already match types that this controller has registered for will be passed. This is used for the case where multiple task controllers have registered for the same task type. This gives the controller a chance to look at the parameters of the task and to reject the execution of the task based on parameters. Controllers can return any of the AcceptLevel levels. The task manager will choose a controller with the lowest AcceptLevel to execute, but will not choose any controller that returns AcceptLevel_NoAccept. Default implementation returns AcceptLevel_Accept. Override this to check parameters and conditionally return a different AccpetLevel.
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: launchExpendableResourceController.h:138
class DtLaunchExpendableResourcePSR:
Definition: launchExpendableResourcePSR.h:27
A DtTaskMsg is a DtRadioMsg with a pointer to a task. The type of the taskMsg is just the type of the...
Definition: taskMessage.h:21
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
Contains the DtMunitionResource class declaration.
Definition: munitionResource.h:24

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)