Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Drive.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: Drive.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Conventional Drive (system) class
13
*/
14
15
#ifndef Drive_h
16
#define Drive_h
17
18
#include "
Types.h
"
19
#include "
System.h
"
20
#include "
Geometry.h
"
21
22
// +--------------------------------------------------------------------+
23
24
class
Bolt
;
25
class
DriveSprite
;
26
class
Light
;
27
class
Sound
;
28
class
Ship
;
29
30
// +--------------------------------------------------------------------+
31
32
struct
DrivePort
{
33
static
const
char
*
TYPENAME
() {
return
"DrivePort"
; }
34
35
DrivePort
(
const
Point
& l,
float
s);
36
~DrivePort
();
37
38
Point
loc
;
39
float
scale
;
40
41
DriveSprite
*
flare
;
42
Bolt
*
trail
;
43
};
44
45
// +--------------------------------------------------------------------+
46
47
class
Drive
:
public
System
48
{
49
public
:
50
enum
SUBTYPE
{
PLASMA
,
FUSION
,
GREEN
,
RED
,
BLUE
,
YELLOW
,
STEALTH
};
51
enum
Constants
{
MAX_ENGINES
=16 };
52
53
Drive
(
SUBTYPE
s,
float
max_thrust,
float
max_aug,
bool
show_trail
=
true
);
54
Drive
(
const
Drive
& rhs);
55
virtual
~Drive
();
56
57
static
void
Initialize
();
58
static
void
Close
();
59
static
void
StartFrame
();
60
61
float
Thrust
(
double
seconds);
62
float
MaxThrust
()
const
{
return
thrust
; }
63
float
MaxAugmenter
()
const
{
return
augmenter
; }
64
int
NumEngines
()
const
;
65
DriveSprite
*
GetFlare
(
int
port)
const
;
66
Bolt
*
GetTrail
(
int
port)
const
;
67
bool
IsAugmenterOn
()
const
;
68
69
virtual
void
AddPort
(
const
Point
& loc,
float
flare_scale=0);
70
virtual
void
CreatePort
(
const
Point
& loc,
float
flare_scale);
71
72
virtual
void
Orient
(
const
Physical
* rep);
73
74
void
SetThrottle
(
double
t,
bool
aug=
false
);
75
virtual
double
GetRequest
(
double
seconds)
const
;
76
77
protected
:
78
float
thrust
;
79
float
augmenter
;
80
float
scale
;
81
float
throttle
;
82
float
augmenter_throttle
;
83
float
intensity
;
84
85
List<DrivePort>
ports
;
86
87
Sound
*
sound
;
88
Sound
*
burner_sound
;
89
bool
show_trail
;
90
};
91
92
#endif Drive_h
93
Stars45
Drive.h
Generated on Tue Jun 5 2012 20:46:52 for Starshatter_Open by
1.8.1