VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
targetSelectionController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
16 #include <map>
17 #include <list>
19 #include "targetRankOperator.h"
20 
29 class DtSimMessage;
30 class DtVrfObjectMessage;
32 
46 
74 {
75 private:
82  const DtTargetSelectionController& orig);
83 public:
84 
85  typedef std::list<DtWeaponComponentInterface*> DtWeaponInterfaceList;
86 
90  DtSimManager* simManager, DtComponentDescriptor* desc=0,
91  DtReaderWriterRegistry *parentRegistry=0);
92 
94  virtual ~DtTargetSelectionController();
95 
97  virtual bool init();
98 
101  virtual DtString type() const;
102 
104  virtual void registerTaskMsgCallbacks();
105 
108  virtual void updateWeaponInterfaceTaskState(DtWeaponComponentInterface* weapIf);
109 
113 
114  static void fireAtTargetTaskCallback(DtSimMessage* msg, void* usr);
115  virtual void processFireAtTargetTask(DtSimMessage* msg);
117 
120 
121  static void weaponListRequestCallback(const DtVrfObjectMessage* msg, void* usr);
122  virtual void processWeaponListRequest(const DtVrfObjectMessage* msg);
124 
126 
127  static void fireNowCallback(DtSimMessage* msg, void* usr);
128  virtual void processFireNow(DtSimMessage* msg);
130 
132  virtual void taskComplete(bool success = true);
133 
135  virtual bool postAddComponentsInit();
136 
139  virtual void preFirstTickInit();
140 
146  virtual void tick();
147 
151  static DtSimComponent* creator(const DtString& name,
152  DtVrfObject* owner,
153  DtSimManager* simManager,
154  DtComponentDescriptor* desc = 0,
155  DtReaderWriterRegistry* parentRegistry = 0);
156 
157 protected:
158  typedef std::set<DtRwSensorContactInfo*, DtTargetRankOperatorWrapper> DtOrderedTargetSet;
159 
161  virtual bool createPorts();
162 
166  virtual bool createOutputPorts();
167 
173  virtual bool createPSR();
174 
176  virtual void registerRadioMessageCallbacks();
177 
179  static void setTargetCallback(DtSimMessage* msg, void* usr);
180 
183  virtual void processSetTarget(DtSimMessage* msg);
184 
193  virtual void selectTargets();
194 
197  virtual bool targetForce(DtForceType force) const;
198 
202  virtual bool validTarget(const DtRwSensorContactInfo& contactInfo,
203  const DtWeaponComponentInterface& weapIf) const;
204 
207  virtual DtEntityTargetInformation targetInfoFromContactInfo(
208  const DtRwSensorContactInfo& contactInfo) const;
209 
212  virtual void updateRegionEvaluators();
213 
217  virtual DtTargetRankOperator* createTargetRankOperator(
218  const DtTargetSelectionCriteria& criteria) const;
219 
222  virtual void setupDetectableForces(DtForceType);
223 
226 
227  static void hostilitiesChangedCallback(DtU8 force, void* usr);
228  virtual void processHostilitiesChanged(DtU8 force);
230 
232  virtual void clearTargets();
233 
235  virtual bool isSurrenderedLifeform(const DtVrfObject* entity) const;
236 
237  virtual bool findFusedTargets(const DtSensorContactInfoList* contactList,
238  const DtWeaponComponentInterface& weapIf, DtRwSensorContactInfo& userTargetInfo,
239  DtOrderedTargetSet & orderedTargets);
240  virtual void setTargetsToWeaponInterface(DtWeaponComponentInterface& weapIf, DtRwSensorContactInfo& userTargetInfo, DtOrderedTargetSet& orderedTargets);
241 
244  virtual void findWeaponControlInterfaces();
245 
248  virtual bool permissionToFire();
249 
250 protected:
251 
259 
267 
271 
273 
275  DtForceType myForce;
276 
281 
285 };

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)