Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Instruction.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: Instruction.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Instruction (NavPoint / Order / Objective) class declaration
13
*/
14
15
#ifndef Instruction_h
16
#define Instruction_h
17
18
#include "
Types.h
"
19
#include "
Geometry.h
"
20
#include "
SimObject.h
"
21
#include "
Text.h
"
22
#include "
RLoc.h
"
23
24
// +--------------------------------------------------------------------+
25
26
class
Ship
;
27
28
// +--------------------------------------------------------------------+
29
30
class
Instruction
:
public
SimObserver
31
{
32
public
:
33
static
const
char
*
TYPENAME
() {
return
"Instruction"
; }
34
35
enum
ACTION
36
{
37
VECTOR
,
38
LAUNCH
,
39
DOCK
,
40
RTB
,
41
42
DEFEND
,
43
ESCORT
,
44
PATROL
,
45
SWEEP
,
46
INTERCEPT
,
47
STRIKE
,
// ground attack
48
ASSAULT
,
// starship attack
49
RECON
,
50
51
//RECALL,
52
//DEPLOY,
53
54
NUM_ACTIONS
55
};
56
57
enum
STATUS
58
{
59
PENDING
,
60
ACTIVE
,
61
SKIPPED
,
62
ABORTED
,
63
FAILED
,
64
COMPLETE
,
65
66
NUM_STATUS
67
};
68
69
enum
FORMATION
70
{
71
DIAMOND
,
72
SPREAD
,
73
BOX
,
74
TRAIL
,
75
76
NUM_FORMATIONS
77
};
78
79
enum
PRIORITY
80
{
81
PRIMARY
= 1,
82
SECONDARY
,
83
BONUS
84
};
85
86
Instruction
(
int
action
,
const
char
* tgt);
87
Instruction
(
const
char
* rgn,
Point
loc,
int
act=
VECTOR
);
88
Instruction
(
SimRegion
* rgn,
Point
loc,
int
act=
VECTOR
);
89
Instruction
(
const
Instruction
& instr);
90
virtual
~Instruction
();
91
92
Instruction
&
operator =
(
const
Instruction
& n);
93
94
// accessors:
95
static
const
char
*
ActionName
(
int
a);
96
static
const
char
*
StatusName
(
int
s);
97
static
const
char
*
FormationName
(
int
f);
98
static
const
char
*
PriorityName
(
int
p);
99
100
const
char
*
RegionName
()
const
{
return
rgn_name
; }
101
SimRegion
*
Region
()
const
{
return
region
; }
102
Point
Location
()
const
;
103
RLoc
&
GetRLoc
() {
return
rloc
; }
104
int
Action
()
const
{
return
action
; }
105
int
Status
()
const
{
return
status
; }
106
int
Formation
()
const
{
return
formation
; }
107
int
Speed
()
const
{
return
speed
; }
108
int
EMCON
()
const
{
return
emcon
; }
109
int
WeaponsFree
()
const
{
return
wep_free
; }
110
int
Priority
()
const
{
return
priority
; }
111
int
Farcast
()
const
{
return
farcast
; }
112
double
HoldTime
()
const
{
return
hold_time
; }
113
114
const
char
*
TargetName
()
const
{
return
tgt_name
; }
115
const
char
*
TargetDesc
()
const
{
return
tgt_desc
; }
116
SimObject
*
GetTarget
();
117
118
void
Evaluate
(
Ship
* s);
119
const
char
*
GetShortDescription
()
const
;
120
const
char
*
GetDescription
()
const
;
121
122
// mutators:
123
void
SetRegion
(
SimRegion
* r) {
region
= r; }
124
void
SetLocation
(
const
Point
& l);
125
void
SetAction
(
int
s) {
action
= s; }
126
void
SetStatus
(
int
s);
127
void
SetFormation
(
int
s) {
formation
= s; }
128
void
SetSpeed
(
int
s) {
speed
= s; }
129
void
SetEMCON
(
int
e) {
emcon
= e; }
130
void
SetWeaponsFree
(
int
f) {
wep_free
= f; }
131
void
SetPriority
(
int
p) {
priority
= p; }
132
void
SetFarcast
(
int
f) {
farcast
= f; }
133
void
SetHoldTime
(
double
t) {
hold_time
= t; }
134
135
void
SetTarget
(
const
char
* n);
136
void
SetTarget
(
SimObject
* s);
137
void
SetTargetDesc
(
const
char
* d);
138
void
ClearTarget
();
139
140
virtual
bool
Update
(
SimObject
* s);
141
virtual
const
char
*
GetObserverName
()
const
;
142
143
protected
:
144
Text
rgn_name
;
145
SimRegion
*
region
;
146
RLoc
rloc
;
147
int
action
;
148
int
formation
;
149
int
status
;
150
int
speed
;
151
152
Text
tgt_name
;
153
Text
tgt_desc
;
154
SimObject
*
target
;
155
int
emcon
;
156
int
wep_free
;
157
int
priority
;
158
int
farcast
;
159
160
double
hold_time
;
161
};
162
163
// +--------------------------------------------------------------------+
164
165
#endif Instruction_h
166
Stars45
Instruction.h
Generated on Tue Jun 5 2012 20:46:55 for Starshatter_Open by
1.8.1