Skip to content

Class RootCommandNode

Namespace: Void.Minecraft.Commands.Brigadier.Tree.Nodes
Assembly: Void.Minecraft.dll

Represents the non-consuming root of a command tree.

public class RootCommandNode : CommandNode, ICommandNode

Inheritance

objectCommandNodeRootCommandNode

Implements

ICommandNode

Inherited Members

CommandNode.IsForks, CommandNode.Requirement, CommandNode.Executor, CommandNode.RedirectTarget, CommandNode.RedirectModifier, CommandNode.Children, CommandNode.Name, CommandNode.UsageText, CommandNode.Examples, CommandNode.SortedKey, CommandNode.AddChild(CommandNode), CommandNode.CanUseAsync(ICommandSource, CancellationToken), CommandNode.FindAmbiguities(AmbiguousConsumer), CommandNode.GetChild(string), CommandNode.RemoveChild(string), CommandNode.GetRelevantNodes(StringReader), CommandNode.CreateBuilder(), CommandNode.IsValidInput(string), CommandNode.ListSuggestionsAsync(CommandContext, SuggestionsBuilder, CancellationToken), CommandNode.Parse(StringReader, CommandContextBuilder), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

RootCommandNode()

Represents the non-consuming root of a command tree.

public RootCommandNode()

Properties

Examples

Gets an empty sequence because the root command node does not consume input directly.

public override IEnumerable<string> Examples { get; }

Property Value

IEnumerable<string>

Name

Gets the name used to index this node under its parent.

public override string Name { get; }

Property Value

string

SortedKey

Gets the key used when ordering nodes.

protected override string SortedKey { get; }

Property Value

string

UsageText

Gets the fragment displayed in command usage.

public override string UsageText { get; }

Property Value

string

Methods

CreateBuilder()

Creates a builder initialized from this node.

public override IArgumentBuilder<CommandNode> CreateBuilder()

Returns

IArgumentBuilder<CommandNode>

The configured builder.

IsValidInput(string)

Determines whether this node can consume a complete sample input.

public override bool IsValidInput(string input)

Parameters

input string

The sample input.

Returns

bool

Whether the input is valid.

ListSuggestionsAsync(CommandContext, SuggestionsBuilder, CancellationToken)

Lists completions for this node.

public override ValueTask<Suggestions> ListSuggestionsAsync(CommandContext context, SuggestionsBuilder builder, CancellationToken cancellationToken)

Parameters

context CommandContext

The parsed context.

builder SuggestionsBuilder

The suggestion builder.

cancellationToken CancellationToken

A cancellation token.

Returns

ValueTask<Suggestions>

The suggestions.

Parse(StringReader, CommandContextBuilder)

Parses this node and records its result in a context builder.

public override void Parse(StringReader reader, CommandContextBuilder context)

Parameters

reader StringReader

The input reader.

context CommandContextBuilder

The parse context builder.