Table of Contents

Struct WeatherFrame

Namespace
FishMMO.Shared.Weather
Assembly
FishMMO.Shared.dll

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

WeatherFrame

DominantPrecipitation

What mostly falls, or None below a trace.

public PrecipitationKind DominantPrecipitation { get; }

Property Value

PrecipitationKind

this[WeatherChannel]

public float this[WeatherChannel channel] { get; set; }

Parameters

channel WeatherChannel

Property Value

float

this[int]

public float this[int index] { get; set; }

Parameters

index int

Property Value

float

StormSeverity

How much of a storm this is, 0..1: the worst of rain, wind, hail and lightning.

public float StormSeverity { get; }

Property Value

float

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

a WeatherFrame
b WeatherFrame
t float

Returns

WeatherFrame

NormalizeTypes(bool)

Makes the type weights sum to 1. With none left, precipitation stops (unless asked not to).

public void NormalizeTypes(bool keepPrecipitationWhenEmpty)

Parameters

keepPrecipitationWhenEmpty bool

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

temperature float

Suppress(WeatherKindMask)

Zeroes the precipitation kinds in a mask and renormalises what remains.

public void Suppress(WeatherKindMask mask)

Parameters

mask WeatherKindMask

ToString()

public override string ToString()

Returns

string