Skip to content

Class DoubleArgumentSerializer

Namespace: Void.Minecraft.Commands.Brigadier.Serializers
Assembly: Void.Minecraft.dll

Reads and writes optional double-argument bounds.

public class DoubleArgumentSerializer : IArgumentSerializer

Inheritance

objectDoubleArgumentSerializer

Implements

IArgumentSerializer

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Fields

HAS_MAXIMUM

Indicates that an explicit maximum follows the flag byte.

public const byte HAS_MAXIMUM = 2

Field Value

byte

HAS_MINIMUM

Indicates that a serialized includes an explicit minimum bound.

public const byte HAS_MINIMUM = 1

Field Value

byte

Properties

Instance

Gets the shared stateless serializer.

public static IArgumentSerializer Instance { get; }

Property Value

IArgumentSerializer

Methods

Deserialize(ref BufferSpan, ProtocolVersion)

Reads argument properties from a buffer.

public IArgumentType Deserialize(ref BufferSpan buffer, ProtocolVersion protocolVersion)

Parameters

buffer BufferSpan

The source buffer.

protocolVersion ProtocolVersion

The source protocol version.

Returns

IArgumentType

The decoded argument type or passthrough value.

Serialize(IArgumentType, ref BufferSpan, ProtocolVersion)

Serializes a double command argument into the Brigadier argument payload.

public void Serialize(IArgumentType argumentType, ref BufferSpan buffer, ProtocolVersion protocolVersion)

Parameters

argumentType IArgumentType

The instance to serialize.

buffer BufferSpan

The destination buffer that receives the flag byte and any explicit bounds.

protocolVersion ProtocolVersion

The protocol version for the serialized payload; this serializer uses the same format for every version.

Exceptions

InvalidCastException

Thrown when argumentType is not a .