Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
QuantumDrive.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: QuantumDrive.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Quantum (JUMP) Drive (system) class
13
*/
14
15
#ifndef QuantumDrive_h
16
#define QuantumDrive_h
17
18
#include "
Types.h
"
19
#include "
System.h
"
20
#include "
Geometry.h
"
21
22
// +--------------------------------------------------------------------+
23
24
class
Ship
;
25
class
SimRegion
;
26
27
// +--------------------------------------------------------------------+
28
29
class
QuantumDrive
:
public
System
30
{
31
public
:
32
enum
SUBTYPE
{
QUANTUM
,
HYPER
};
33
34
QuantumDrive
(
SUBTYPE
s,
double
capacity
,
double
sink_rate
);
35
QuantumDrive
(
const
QuantumDrive
& rhs);
36
virtual
~QuantumDrive
();
37
38
enum
ACTIVE_STATES
{
39
ACTIVE_READY
,
ACTIVE_COUNTDOWN
,
ACTIVE_PREWARP
,
ACTIVE_POSTWARP
40
};
41
42
void
SetDestination
(
SimRegion
* rgn,
const
Point
& loc);
43
bool
Engage
(
bool
immediate=
false
);
44
int
ActiveState
()
const
{
return
active_state
; }
45
double
WarpFactor
()
const
{
return
warp_fov
; }
46
double
JumpTime
()
const
{
return
jump_time
; }
47
virtual
void
PowerOff
();
48
49
virtual
void
ExecFrame
(
double
seconds);
50
51
void
SetShip
(
Ship
* s) {
ship
= s; }
52
Ship
*
GetShip
()
const
{
return
ship
; }
53
54
double
GetCountdown
()
const
{
return
countdown
; }
55
void
SetCountdown
(
double
d) {
countdown
= d; }
56
57
protected
:
58
void
Jump
();
59
void
AbortJump
();
60
61
int
active_state
;
62
63
Ship
*
ship
;
64
double
warp_fov
;
65
double
jump_time
;
66
double
countdown
;
67
68
SimRegion
*
dst_rgn
;
69
Point
dst_loc
;
70
};
71
72
#endif // QuantumDrive_h
73
Stars45
QuantumDrive.h
Generated on Tue Jun 5 2012 20:47:07 for Starshatter_Open by
1.8.1