Table of Contents

Class ZoneReading

Namespace
Valheim.Testing.Game
Assembly
Valheim.Testing.Game.dll

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
object
ZoneReading

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

Reference ZoneId
Range SimulationRange
Zones IReadOnlyList<ZoneState>
Data JsonElement

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

SimulationRange

Reference

public ZoneId Reference { get; init; }

Property Value

ZoneId

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

data JsonElement
zones IReadOnlyList<ZoneId>

Returns

ZoneReading

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

client GameActor
capability Capability
zones IReadOnlyList<ZoneId>

Returns

ZoneReading

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.