Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
SimEvent.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: SimEvent.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Simulation Universe and Region classes
13
*/
14
15
#ifndef SimEvent_h
16
#define SimEvent_h
17
18
#include "
Types.h
"
19
#include "
List.h
"
20
#include "
Text.h
"
21
22
// +--------------------------------------------------------------------+
23
24
class
Sim
;
25
class
SimRegion
;
26
class
SimObject
;
27
class
SimObserver
;
28
class
SimHyper
;
29
class
CombatGroup
;
30
class
CombatUnit
;
31
32
// +--------------------------------------------------------------------+
33
34
class
SimEvent
35
{
36
public
:
37
static
const
char
*
TYPENAME
() {
return
"SimEvent"
; }
38
39
enum
EVENT
{
LAUNCH
=1,
DOCK
,
LAND
,
EJECT
,
CRASH
,
COLLIDE
,
DESTROYED
,
40
MAKE_ORBIT
,
BREAK_ORBIT
,
QUANTUM_JUMP
,
41
LAUNCH_SHIP
,
RECOVER_SHIP
,
42
FIRE_GUNS
,
FIRE_MISSILE
,
DROP_DECOY
,
43
GUNS_KILL
,
MISSILE_KILL
,
44
LAUNCH_PROBE
,
SCAN_TARGET
45
};
46
47
SimEvent
(
int
event,
const
char
* tgt=0,
const
char
* info=0);
48
~SimEvent
();
49
50
int
GetEvent
()
const
{
return
event; }
51
int
GetTime
()
const
{
return
time; }
52
Text
GetEventDesc
()
const
;
53
const
char
*
GetTarget
()
const
{
return
target; }
54
const
char
*
GetInfo
()
const
{
return
info; }
55
int
GetCount
()
const
{
return
count; }
56
57
void
SetTarget
(
const
char
* tgt);
58
void
SetInfo
(
const
char
* info);
59
void
SetCount
(
int
count);
60
void
SetTime
(
int
time);
61
62
private
:
63
int
event;
64
int
time;
65
Text
target;
66
Text
info;
67
int
count;
68
};
69
70
// +--------------------------------------------------------------------+
71
72
class
ShipStats
73
{
74
public
:
75
static
const
char
*
TYPENAME
() {
return
"ShipStats"
; }
76
77
ShipStats
(
const
char
* name,
int
iff=0);
78
~ShipStats
();
79
80
static
void
Initialize
();
81
static
void
Close
();
82
static
ShipStats
*
Find
(
const
char
* name);
83
static
int
NumStats
();
84
static
ShipStats
*
GetStats
(
int
i);
85
86
void
Summarize
();
87
88
const
char
*
GetName
()
const
{
return
name; }
89
const
char
*
GetType
()
const
{
return
type; }
90
const
char
*
GetRole
()
const
{
return
role; }
91
const
char
*
GetRegion
()
const
{
return
region; }
92
CombatGroup
*
GetCombatGroup
()
const
{
return
combat_group; }
93
CombatUnit
*
GetCombatUnit
()
const
{
return
combat_unit; }
94
int
GetElementIndex
()
const
{
return
elem_index; }
95
int
GetShipClass
()
const
{
return
ship_class; }
96
int
GetIFF
()
const
{
return
iff; }
97
int
GetGunKills
()
const
{
return
kill1; }
98
int
GetMissileKills
()
const
{
return
kill2; }
99
int
GetDeaths
()
const
{
return
lost; }
100
int
GetColls
()
const
{
return
coll; }
101
int
GetPoints
()
const
{
return
points; }
102
int
GetCommandPoints
()
const
{
return
cmd_points; }
103
104
int
GetGunShots
()
const
{
return
gun_shots; }
105
int
GetGunHits
()
const
{
return
gun_hits; }
106
int
GetMissileShots
()
const
{
return
missile_shots; }
107
int
GetMissileHits
()
const
{
return
missile_hits; }
108
109
bool
IsPlayer
()
const
{
return
player; }
110
111
List<SimEvent>
&
112
GetEvents
() {
return
events; }
113
SimEvent
*
AddEvent
(
SimEvent
* e);
114
SimEvent
*
AddEvent
(
int
event,
const
char
* tgt=0,
const
char
* info=0);
115
bool
HasEvent
(
int
event);
116
117
void
SetShipClass
(
int
c) { ship_class = c; }
118
void
SetIFF
(
int
i) { iff = i; }
119
void
SetType
(
const
char
* t);
120
void
SetRole
(
const
char
* r);
121
void
SetRegion
(
const
char
* r);
122
void
SetCombatGroup
(
CombatGroup
* g);
123
void
SetCombatUnit
(
CombatUnit
* u);
124
void
SetElementIndex
(
int
n);
125
void
SetPlayer
(
bool
p);
126
127
void
AddGunShot
() { gun_shots++; }
128
void
AddGunHit
() { gun_hits++; }
129
void
AddMissileShot
() { missile_shots++; }
130
void
AddMissileHit
() { missile_hits++; }
131
void
AddPoints
(
int
p) { points += p; }
132
void
AddCommandPoints
(
int
p) { cmd_points += p; }
133
134
private
:
135
Text
name;
136
Text
type;
137
Text
role;
138
Text
region;
139
CombatGroup
* combat_group;
140
CombatUnit
* combat_unit;
141
bool
player;
142
int
elem_index;
143
int
ship_class;
144
int
iff;
145
int
kill1;
146
int
kill2;
147
int
lost;
148
int
coll;
149
150
int
gun_shots;
151
int
gun_hits;
152
153
int
missile_shots;
154
int
missile_hits;
155
156
int
points;
157
int
cmd_points;
158
159
List<SimEvent>
events;
160
};
161
162
#endif SimEvent_h
163
Stars45
SimEvent.h
Generated on Tue Jun 5 2012 20:47:11 for Starshatter_Open by
1.8.1