Struct WeatherFrame
One value per WeatherChannel. A value type with named fields so sampling weather for every player every second allocates nothing.
[Serializable]
public struct WeatherFrame
- Inherited Members
Properties
Clear
A calm, clear sky.
public static WeatherFrame Clear { get; }
Property Value
DominantPrecipitation
What mostly falls, or None below a trace.
public PrecipitationKind DominantPrecipitation { get; }
Property Value
this[WeatherChannel]
public float this[WeatherChannel channel] { get; set; }
Parameters
channelWeatherChannel
Property Value
this[int]
public float this[int index] { get; set; }
Parameters
indexint
Property Value
StormSeverity
How much of a storm this is, 0..1: the worst of rain, wind, hail and lightning.
public float StormSeverity { get; }
Property Value
WindVector
Wind as a horizontal vector in world space, 0..1 per axis.
public Vector2 WindVector { get; }
Property Value
- Vector2
Methods
DeriveSurfaceRates()
Fills the surface channels from what is falling, so a template only has to author the sky. An authored value that is higher is kept.
public void DeriveSurfaceRates()
Lerp(in WeatherFrame, in WeatherFrame, float)
Moves every channel toward another frame by t.
public static WeatherFrame Lerp(in WeatherFrame a, in WeatherFrame b, float t)
Parameters
aWeatherFramebWeatherFrametfloat
Returns
NormalizeTypes(bool)
Makes the type weights sum to 1. With none left, precipitation stops (unless asked not to).
public void NormalizeTypes(bool keepPrecipitationWhenEmpty)
Parameters
keepPrecipitationWhenEmptybool
RetypeForTemperature(float)
Re-types rain and snow for the local temperature: the same storm falls as rain in a warm valley and as snow on a cold peak, with sleet between.
public void RetypeForTemperature(float temperature)
Parameters
temperaturefloat
Suppress(WeatherKindMask)
Zeroes the precipitation kinds in a mask and renormalises what remains.
public void Suppress(WeatherKindMask mask)
Parameters
maskWeatherKindMask
ToString()
public override string ToString()