Skip to content

GaugeReading

public readonly struct GaugeReading

Namespace Chassis.Api

Added in 1.2.0

One value of a gauge source, and whether this peer knows it.

A value is not valid when this peer cannot know it: the throttle of a car an NPC drives on a client, the odometer before the host’s first update, a mod source that threw. Gauges hold their last position while a value is not valid.

public readonly float Value

Added in 1.2.0

The value, in the unit of its source; 0 when not valid.

public readonly bool Valid

Added in 1.2.0

True when this peer knows the value.

public static GaugeReading Invalid { get; }

Added in 1.2.0

A reading this peer does not know.

public GaugeReading(float value, bool valid)

Added in 1.2.0

A reading with a value.

public override string ToString()

Added in 1.2.0

The value with two decimals, or ”-” when not valid.