Skip to content

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

objectBoolArgumentType

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

IEnumerable<string>

Methods

Bool()

Creates a Boolean argument type.

public static BoolArgumentType Bool()

Returns

BoolArgumentType

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

bool

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

ValueTask<Suggestions>

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

IArgumentValue

The parsed argument value.