Skip to content

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

objectFloatArgumentType

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

IEnumerable<string>

Maximum

Gets the inclusive maximum.

public required float Maximum { get; init; }

Property Value

float

Minimum

Gets the inclusive minimum.

public required float Minimum { get; init; }

Property Value

float

Methods

FloatArgument()

Creates an argument whose minimum and maximum both evaluate to .

public static FloatArgumentType FloatArgument()

Returns

FloatArgumentType

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 maximum.

public static FloatArgumentType FloatArgument(float min)

Parameters

min float

The inclusive minimum.

Returns

FloatArgumentType

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

FloatArgumentType

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

float

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

IArgumentValue

The parsed argument value.