Starshatter_Open
Open source Starshatter engine
 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,
33  FOG,
35 
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 
56  double period;
58  double ceiling;
59  double visibility;
60 
63 };
64 
65 
66 #endif Weather_h
67