Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TacticalAI.h
Go to the documentation of this file.
1 /* Project Starshatter 4.5
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: TacticalAI.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Common base class and interface for mid-level (tactical) AI
13 */
14 
15 #ifndef TacticalAI_h
16 #define TacticalAI_h
17 
18 #include "Types.h"
19 #include "Director.h"
20 
21 // +--------------------------------------------------------------------+
22 
23 class Ship;
24 class ShipAI;
25 class Instruction;
26 class CarrierAI;
27 
28 // +--------------------------------------------------------------------+
29 
30 class TacticalAI : public Director
31 {
32 public:
33  TacticalAI(ShipAI* ai);
34  virtual ~TacticalAI();
35 
36  enum ROE {
43  };
44 
45  virtual void ExecFrame(double seconds);
46 
47  virtual ROE RulesOfEngagement() const { return roe; }
48  virtual double ThreatLevel() const { return threat_level; }
49  virtual double SupportLevel() const { return support_level; }
50 
51 protected:
52  // pick the best target if we don't have one yet:
53  virtual void CheckOrders();
54  virtual bool CheckShipOrders();
55  virtual bool ProcessOrders();
56  virtual bool CheckFlightPlan();
57  virtual bool CheckObjectives();
58 
59  virtual void SelectTarget();
60  virtual void SelectTargetDirected(Ship* tgt=0);
61  virtual void SelectTargetOpportunity();
62  virtual void CheckTarget();
63  virtual void FindThreat();
64  virtual void FindSupport();
65  virtual void FindFormationSlot(int formation);
66 
67  virtual bool CanTarget(Ship* tgt);
68  virtual void ClearRadioOrders();
69 
73 
76 
77  double agression;
80  int action;
81  int exec_time;
83 
84  double threat_level;
85  double support_level;
86 };
87 
88 // +--------------------------------------------------------------------+
89 
90 #endif TacticalAI_h
91