forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
weather_gen.h
70 lines (61 loc) · 2.27 KB
/
weather_gen.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#ifndef CATA_SRC_WEATHER_GEN_H
#define CATA_SRC_WEATHER_GEN_H
#include <iosfwd>
#include <map>
#include <vector>
#include "calendar.h"
#include "type_id.h"
class JsonObject;
struct tripoint;
struct w_point {
double temperature = 0;
double humidity = 0;
double pressure = 0;
double windpower = 0;
std::string wind_desc;
int winddirection = 0;
season_effective_time time;
};
class weather_generator
{
public:
// Average temperature
double base_temperature = 0;
// Average humidity
double base_humidity = 0;
// Average atmospheric pressure
double base_pressure = 0;
//Average yearly windspeed
double base_wind = 0;
//How much the wind peaks above average
int base_wind_distrib_peaks = 0;
int summer_temp_manual_mod = 0;
int spring_temp_manual_mod = 0;
int autumn_temp_manual_mod = 0;
int winter_temp_manual_mod = 0;
int spring_humidity_manual_mod = 0;
int summer_humidity_manual_mod = 0;
int autumn_humidity_manual_mod = 0;
int winter_humidity_manual_mod = 0;
//How much the wind follows seasonal variation ( lower means more change )
int base_wind_season_variation = 0;
static int current_winddir;
std::vector<std::string> weather_types;
weather_generator();
/**
* Input should be an absolute position in the map square system (the one used
* by the @ref map). You can use @ref map::getabs to get an absolute position from a
* relative position (relative to the map you called getabs on).
*/
w_point get_weather( const tripoint &, const time_point &, unsigned ) const;
weather_type_id get_weather_conditions( const tripoint &, const time_point &, unsigned seed ) const;
weather_type_id get_weather_conditions( const w_point & ) const;
int get_wind_direction( season_type ) const;
int convert_winddir( int ) const;
int get_water_temperature() const;
void test_weather( unsigned seed ) const;
double get_weather_temperature( const tripoint &, const time_point &, unsigned ) const;
static weather_generator load( const JsonObject &jo );
};
#endif // CATA_SRC_WEATHER_GEN_H