Class FloatArgumentType
Namespace: Void.Minecraft.Commands.Brigadier.ArgumentTypes
Assembly: Void.Minecraft.dll
Parses single-precision values constrained to an inclusive range.
public record FloatArgumentType : IArgumentType, IAnyArgumentType, IEquatable<FloatArgumentType>Inheritance
Implements
IArgumentType, IAnyArgumentType, IEquatable<FloatArgumentType>
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 float Maximum { get; init; }Property Value
Minimum
Gets the inclusive minimum.
public required float Minimum { get; init; }Property Value
Methods
FloatArgument()
Creates an argument whose minimum and maximum both evaluate to
public static FloatArgumentType FloatArgument()Returns
The argument type.
Remarks
The minimum is initialized from -float.MinValue, which equals the positive maximum.
FloatArgument(float)
Creates an argument with a minimum and
public static FloatArgumentType FloatArgument(float min)Parameters
min float
The inclusive minimum.
Returns
The argument type.
FloatArgument(float, float)
Creates an argument with explicit inclusive bounds.
public static FloatArgumentType FloatArgument(float min, float max)Parameters
min float
The inclusive minimum.
max float
The inclusive maximum.
Returns
The argument type. The bounds are retained without validation.
GetFloat(CommandContext, string)
Gets a parsed float argument from a context.
public static float GetFloat(CommandContext context, string name)Parameters
context CommandContext
The command context.
name string
The argument name.
Returns
The parsed single-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.