Class WeatherClimateSeason
The weather odds for one climate and season.
Inheritance
WeatherClimateSeason
Assembly: Assembly-CSharp.dll
Syntax
[Serializable]
public class WeatherClimateSeason
Constructors
|
Improve this Doc
View Source
WeatherClimateSeason()
Declaration
public WeatherClimateSeason()
Fields
|
Improve this Doc
View Source
Cloudy
Declaration
Field Value
|
Improve this Doc
View Source
Fog
Declaration
Field Value
|
Improve this Doc
View Source
Overcast
Declaration
Field Value
|
Improve this Doc
View Source
Rain
Declaration
Field Value
|
Improve this Doc
View Source
Snow
Declaration
Field Value
|
Improve this Doc
View Source
Sunny
Declaration
Field Value
|
Improve this Doc
View Source
Thunder
Declaration
Field Value
Methods
|
Improve this Doc
View Source
CompileOdds()
Compiles the odds into a sorted list for optimized look ups during weather forecasting.
Declaration
public void CompileOdds()
|
Improve this Doc
View Source
GetWeather()
Get the next randomly chosen weather.
The brute force way to compute this is to create an N-element array with the weather types and pick a random
index. N is 100/min_precision. For us, min_precision is 1% and N is 100.
This uses a cumulative distribution list of weather chances. Generates a random value and iterate across
until we find a >= cumulative probability. This cuts down the list to the number of weather types (7).
This isn't critical since both methods are constant time and the weather logic is infrequent. But oh well!
Declaration
public WeatherType GetWeather()
Returns
Type |
Description |
WeatherType |
Next weather pattern to move towards.
|
|
Improve this Doc
View Source
ToString()
Makes a pretty formatted string with all weather odds.
Declaration
public override string ToString()
Returns
Overrides