Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Power.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: Power.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Power generation and usage classes
13
*/
14
15
#ifndef Power_h
16
#define Power_h
17
18
#include "
Types.h
"
19
#include "
System.h
"
20
#include "
List.h
"
21
22
// +--------------------------------------------------------------------+
23
24
class
PowerSource
:
public
System
25
{
26
public
:
27
enum
SUBTYPE
{
BATTERY
,
AUX
,
FUSION
};
28
29
PowerSource
(
SUBTYPE
s,
double
max_output
,
double
fuel_ratio
=0);
30
PowerSource
(
const
PowerSource
& rhs);
31
32
virtual
void
ExecFrame
(
double
seconds);
33
34
void
AddClient
(
System
* client);
35
void
RemoveClient
(
System
* client);
36
37
List<System>
&
Clients
() {
return
clients
; }
38
39
virtual
int
Charge
()
const
;
40
41
virtual
void
SetFuelRange
(
double
hours);
42
43
bool
RouteChanged
()
const
{
return
route_changed
; }
44
void
RouteScanned
() {
route_changed
=
false
; }
45
46
// override from System:
47
virtual
void
SetPowerLevel
(
double
level);
48
virtual
void
SetOverride
(
bool
over);
49
50
// for power drain damage:
51
virtual
void
DrainPower
(
double
to_level);
52
53
protected
:
54
float
max_output
;
55
float
fuel_ratio
;
56
List<System>
clients
;
57
bool
route_changed
;
58
float
requested_power_level
;
59
};
60
61
#endif Power_h
62
Stars45
Power.h
Generated on Tue Jun 5 2012 20:47:07 for Starshatter_Open by
1.8.1