Class BoolArgumentType
Namespace: Void.Minecraft.Commands.Brigadier.ArgumentTypes
Assembly: Void.Minecraft.dll
Parses the case-insensitive Boolean tokens true and false.
public record BoolArgumentType : IArgumentType, IAnyArgumentType, IEquatable<BoolArgumentType>Inheritance
Implements
IArgumentType, IAnyArgumentType, IEquatable<BoolArgumentType>
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
Methods
Bool()
Creates a Boolean argument type.
public static BoolArgumentType Bool()Returns
A new Boolean argument type.
GetBool(CommandContext, string)
Gets a parsed Boolean argument from a context.
public static bool GetBool(CommandContext context, string name)Parameters
context CommandContext
The command context.
name string
The argument name.
Returns
The parsed Boolean.
ListSuggestionsAsync(CommandContext, SuggestionsBuilder, CancellationToken)
Lists completions for this argument type.
public virtual ValueTask<Suggestions> ListSuggestionsAsync(CommandContext context, SuggestionsBuilder builder, CancellationToken cancellationToken)Parameters
context CommandContext
The parsed command context.
builder SuggestionsBuilder
The suggestion builder.
cancellationToken CancellationToken
A token that may cancel asynchronous providers.
Returns
The suggestions; the default implementation returns
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.