Skip to content

Class LiteralCommandNode

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

Represents a command node that consumes one exact literal token.

public class LiteralCommandNode : CommandNode, ICommandNode

Inheritance

objectCommandNodeLiteralCommandNode

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

LiteralCommandNode(string, CommandExecutor?, CommandRequirement?, CommandNode?, RedirectModifier?, bool)

Represents a command node that consumes one exact literal token.

public LiteralCommandNode(string literal, CommandExecutor? executor, CommandRequirement? requirement, CommandNode? redirectTarget, RedirectModifier? redirectModifier, bool isForks)

Parameters

literal string

The case-sensitive literal.

executor CommandExecutor?

The command executor.

requirement CommandRequirement?

The source access requirement.

redirectTarget CommandNode?

The redirect target.

redirectModifier RedirectModifier?

The redirected-source modifier.

isForks bool

Whether redirection forks.

Properties

Examples

Gets representative inputs used for ambiguity analysis.

public override IEnumerable<string> Examples { get; }

Property Value

IEnumerable<string>

Literal

Gets the exact literal consumed by this node.

public string Literal { get; }

Property Value

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 contextBuilder)

Parameters

reader StringReader

The input reader.

contextBuilder CommandContextBuilder

ToString()

Returns a diagnostic representation containing the literal.

public override string ToString()

Returns

string

The diagnostic representation.