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
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
Maximum
Gets the inclusive maximum.
public required double Maximum { get; init; }Property Value
Minimum
Gets the inclusive minimum.
public required double Minimum { get; init; }Property Value
Methods
DoubleArgument()
Creates an argument whose minimum and maximum both evaluate to
public static DoubleArgumentType DoubleArgument()Returns
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
public static DoubleArgumentType DoubleArgument(double min)Parameters
min double
The inclusive minimum.
Returns
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
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
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
The parsed argument value.