Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SeekerAI.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: SeekerAI.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Seeker Missile (low-level) Artifical Intelligence class
13 */
14 
15 #ifndef SeekerAI_h
16 #define SeekerAI_h
17 
18 #include "Types.h"
19 #include "SteerAI.h"
20 #include "SimObject.h"
21 
22 // +--------------------------------------------------------------------+
23 
24 class Ship;
25 class Shot;
26 
27 class SeekerAI : public SteerAI
28 {
29 public:
30  SeekerAI(SimObject* s);
31  virtual ~SeekerAI();
32 
33  virtual int Type() const { return 1001; }
34  virtual int Subframe() const { return true; }
35 
36  virtual void ExecFrame(double seconds);
37  virtual void FindObjective();
38  virtual void SetTarget(SimObject* targ, System* sub=0);
39  virtual bool Overshot();
40 
41  virtual void SetPursuit(int p) { pursuit = p; }
42  virtual int GetPursuit() const { return pursuit; }
43 
44  virtual void SetDelay(double d) { delay = d; }
45  virtual double GetDelay() const { return delay; }
46 
47  virtual bool Update(SimObject* obj);
48  virtual const char* GetObserverName() const;
49 
50 protected:
51  // behaviors:
52  virtual Steer AvoidCollision();
53  virtual Steer SeekTarget();
54 
55  // accumulate behaviors:
56  virtual void Navigator();
57 
58  virtual void CheckDecoys(double distance);
59 
62  int pursuit; // type of pursuit curve
63  // 1: pure pursuit
64  // 2: lead pursuit
65 
66  double delay; // don't start seeking until then
67  bool overshot;
68 };
69 
70 // +--------------------------------------------------------------------+
71 
72 #endif SeekerAI_h
73