Class ZoneReading
One reading of ValheimCLI's valheim.observe/zones observation: the zone of the
client's reference position (where its player is), its simulation distance, and the requested zones. Data
is the reading as the adapter returned it, for evidence.
public sealed record ZoneReading
- Inheritance
-
objectZoneReading
Constructors
ZoneReading(ZoneId, SimulationRange, IReadOnlyList<ZoneState>, JsonElement)
One reading of ValheimCLI's valheim.observe/zones observation: the zone of the
client's reference position (where its player is), its simulation distance, and the requested zones. Data
is the reading as the adapter returned it, for evidence.
public ZoneReading(ZoneId Reference, SimulationRange Range, IReadOnlyList<ZoneState> Zones, JsonElement Data)
Parameters
ReferenceZoneIdRangeSimulationRangeZonesIReadOnlyList<ZoneState>DataJsonElement
Fields
Source
public const string Source = "zone-presence"
Field Value
- string
Properties
Data
public JsonElement Data { get; init; }
Property Value
- JsonElement
Range
public SimulationRange Range { get; init; }
Property Value
Reference
public ZoneId Reference { get; init; }
Property Value
Zones
public IReadOnlyList<ZoneState> Zones { get; init; }
Property Value
- IReadOnlyList<ZoneState>
Methods
Parse(JsonElement, IReadOnlyList<ZoneId>)
Parses a reading and requires exactly the zones asked for, each once.
public static ZoneReading Parse(JsonElement data, IReadOnlyList<ZoneId> zones)
Parameters
dataJsonElementzonesIReadOnlyList<ZoneId>
Returns
Read(GameActor, Capability, IReadOnlyList<ZoneId>)
Reads zones through capability; incomplete or malformed readings throw.
public static ZoneReading Read(GameActor client, Capability capability, IReadOnlyList<ZoneId> zones)
Parameters
clientGameActorcapabilityCapabilityzonesIReadOnlyList<ZoneId>
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.