Skip to content

Class LongArgumentType

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

Constrains a numeric token to an inclusive 64-bit range.

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

Inheritance

objectLongArgumentType

Implements

IArgumentType, IAnyArgumentType, IEquatable<LongArgumentType>

Inherited Members

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

Remarks

The current parser consumes the token through , so values outside the 32-bit range fail before the 64-bit bounds are checked.

Properties

Examples

Gets representative valid input strings.

public IEnumerable<string> Examples { get; }

Property Value

IEnumerable<string>

Maximum

Gets the inclusive maximum.

public required long Maximum { get; init; }

Property Value

long

Minimum

Gets the inclusive minimum.

public required long Minimum { get; init; }

Property Value

long

Methods

GetLong(CommandContext, string)

Gets a parsed long argument from a context.

public static long GetLong(CommandContext context, string name)

Parameters

context CommandContext

The command context.

name string

The argument name.

Returns

long

The parsed long integer.

LongArgument()

Creates an argument configured with the complete 64-bit range.

public static LongArgumentType LongArgument()

Returns

LongArgumentType

The argument type.

LongArgument(long)

Creates an argument with a minimum and maximum.

public static LongArgumentType LongArgument(long min)

Parameters

min long

The inclusive minimum.

Returns

LongArgumentType

The argument type.

LongArgument(long, long)

Creates an argument with explicit inclusive bounds.

public static LongArgumentType LongArgument(long min, long max)

Parameters

min long

The inclusive minimum.

max long

The inclusive maximum.

Returns

LongArgumentType

The argument type. The bounds are retained without validation.

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.