Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Weather.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: Weather.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Manages local weather conditions according to the system stardate
13
*/
14
15
#ifndef Weather_h
16
#define Weather_h
17
18
#include "
Types.h
"
19
#include "
Text.h
"
20
21
// +--------------------------------------------------------------------+
22
23
class
Weather
24
{
25
public
:
26
Weather
();
27
virtual
~Weather
();
28
29
enum
STATE
{
CLEAR
,
30
HIGH_CLOUDS
,
31
MODERATE_CLOUDS
,
32
OVERCAST
,
33
FOG
,
34
STORM
,
35
36
NUM_STATES
37
};
38
39
virtual
void
Update
();
40
41
// accessors:
42
STATE
State
()
const
{
return
state
; }
43
Text
Description
()
const
;
44
double
Period
()
const
{
return
period
; }
45
double
Chance
(
STATE
s)
const
{
return
chances
[(int)s]; }
46
double
Ceiling
()
const
{
return
ceiling
; }
47
double
Visibility
()
const
{
return
visibility
; }
48
49
void
SetPeriod
(
double
p) {
period
= p; }
50
void
SetChance
(
int
n,
double
c);
51
52
protected
:
53
void
NormalizeChances
();
54
55
STATE
state
;
56
double
period
;
57
double
chances
[
NUM_STATES
];
58
double
ceiling
;
59
double
visibility
;
60
61
STATE
active_states
[
NUM_STATES
];
62
double
thresholds
[
NUM_STATES
];
63
};
64
65
66
#endif Weather_h
67
Stars45
Weather.h
Generated on Tue Jun 5 2012 20:47:17 for Starshatter_Open by
1.8.1