blob: 99dc7249902048e3feaf527b147ebbc5bcd1b7bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
/* Project Starshatter 4.5
Destroyer Studios LLC
Copyright © 1997-2004. All Rights Reserved.
SUBSYSTEM: Stars.exe
FILE: NavAI.h
AUTHOR: John DiCamillo
OVERVIEW
========
Automatic Navigator
*/
#ifndef NavAI_h
#define NavAI_h
#include "Types.h"
#include "Geometry.h"
#include "System.h"
#include "ShipAI.h"
#include "Text.h"
// +--------------------------------------------------------------------+
class Farcaster;
// +--------------------------------------------------------------------+
class NavAI : public ShipAI
{
public:
NavAI(Ship* s);
virtual ~NavAI();
enum { DIR_TYPE = 2000 };
virtual int Type() const { return DIR_TYPE; }
virtual void ExecFrame(double seconds);
virtual int Subframe() const { return true; }
void Disengage();
bool Complete() const { return complete; }
protected:
// behaviors:
virtual Steer SeekTarget();
// steering functions:
virtual Point Transform(const Point& pt);
virtual Steer Seek(const Point& point);
virtual Steer Flee(const Point& point);
virtual Steer Avoid(const Point& point, float radius);
virtual Steer AvoidTerrain();
// accumulate behaviors:
virtual void Navigator();
virtual void FindObjective();
virtual void HelmControl();
virtual void ThrottleControl();
bool complete;
int drop_state;
int quantum_state;
int terrain_warning;
double brakes;
Farcaster* farcaster;
};
// +--------------------------------------------------------------------+
#endif NavAI_h
|