Skip to content

Class ArgumentParserDefinition

Namespace: Void.Minecraft.Network.Definitions
Assembly: Void.Minecraft.dll

Associates an argument serializer and optional runtime argument type with its protocol identifier mapping.

public record ArgumentParserDefinition : IEquatable<ArgumentParserDefinition>

Inheritance

objectArgumentParserDefinition

Implements

IEquatable<ArgumentParserDefinition>

Inherited Members

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

Constructors

ArgumentParserDefinition(IArgumentSerializer, Type?, ArgumentSerializerMapping)

Associates an argument serializer and optional runtime argument type with its protocol identifier mapping.

public ArgumentParserDefinition(IArgumentSerializer Serializer, Type? ArgumentType, ArgumentSerializerMapping Mapping)

Parameters

Serializer IArgumentSerializer

The serializer used to read and write parser properties.

ArgumentType Type?

The concrete argument type, or null for passthrough or otherwise untyped parsers.

Mapping ArgumentSerializerMapping

The resource identifier and numeric parser identifiers by protocol version.

Properties

ArgumentType

The concrete argument type, or null for passthrough or otherwise untyped parsers.

public Type? ArgumentType { get; init; }

Property Value

Type?

Mapping

The resource identifier and numeric parser identifiers by protocol version.

public ArgumentSerializerMapping Mapping { get; init; }

Property Value

ArgumentSerializerMapping

Serializer

The serializer used to read and write parser properties.

public IArgumentSerializer Serializer { get; init; }

Property Value

IArgumentSerializer

Methods

From(ArgumentSerializerMapping)

Creates an untyped definition using the empty passthrough serializer.

public static ArgumentParserDefinition From(ArgumentSerializerMapping mapping)

Parameters

mapping ArgumentSerializerMapping

The parser identifier mapping.

Returns

ArgumentParserDefinition

An untyped parser definition.

From(IArgumentSerializer, ArgumentSerializerMapping)

Creates an untyped definition using an explicit serializer.

public static ArgumentParserDefinition From(IArgumentSerializer serializer, ArgumentSerializerMapping mapping)

Parameters

serializer IArgumentSerializer

The serializer for parser properties.

mapping ArgumentSerializerMapping

The parser identifier mapping.

Returns

ArgumentParserDefinition

An untyped parser definition whose is null.

From<TArgumentType>(IArgumentSerializer, ArgumentSerializerMapping)

Creates a typed definition using an explicit serializer.

public static ArgumentParserDefinition From<TArgumentType>(IArgumentSerializer serializer, ArgumentSerializerMapping mapping)

Parameters

serializer IArgumentSerializer

The serializer for parser properties.

mapping ArgumentSerializerMapping

The parser identifier mapping.

Returns

ArgumentParserDefinition

A definition whose is typeof(TArgumentType).

Type Parameters

TArgumentType

The runtime argument type associated with the parser.