Skip to content

Class DoubleArgumentType

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

Parses double-precision values constrained to an inclusive range.

public record DoubleArgumentType : IArgumentType, IAnyArgumentType, IEquatable<DoubleArgumentType>

Inheritance

objectDoubleArgumentType

Implements

IArgumentType, IAnyArgumentType, IEquatable<DoubleArgumentType>

Inherited Members

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

Properties

Examples

Gets representative valid input strings.

public IEnumerable<string> Examples { get; }

Property Value

IEnumerable<string>

Maximum

Gets the inclusive maximum.

public required double Maximum { get; init; }

Property Value

double

Minimum

Gets the inclusive minimum.

public required double Minimum { get; init; }

Property Value

double

Methods

DoubleArgument()

Creates an argument whose minimum and maximum both evaluate to .

public static DoubleArgumentType DoubleArgument()

Returns

DoubleArgumentType

The argument type.

Remarks

The minimum is initialized from -double.MinValue, which equals the positive maximum.

DoubleArgument(double)

Creates an argument with a minimum and maximum.

public static DoubleArgumentType DoubleArgument(double min)

Parameters

min double

The inclusive minimum.

Returns

DoubleArgumentType

The argument type.

DoubleArgument(double, double)

Creates an argument with explicit inclusive bounds.

public static DoubleArgumentType DoubleArgument(double min, double max)

Parameters

min double

The inclusive minimum.

max double

The inclusive maximum.

Returns

DoubleArgumentType

The argument type. The bounds are retained without validation.

GetDouble(CommandContext, string)

Gets a parsed double argument from a context.

public static double GetDouble(CommandContext context, string name)

Parameters

context CommandContext

The command context.

name string

The argument name.

Returns

double

The parsed double-precision value.

Parse(StringReader)

Parses a value from the reader’s current cursor.

public IArgumentValue Parse(StringReader reader)

Parameters

reader StringReader

The command reader to consume.

Returns

IArgumentValue

The parsed argument value.