Class SuggestionsBuilder
Namespace: Void.Minecraft.Commands.Brigadier.Suggestion
Assembly: Void.Minecraft.dll
Accumulates replacements for the suffix of command input beginning at a fixed cursor.
public class SuggestionsBuilderInheritance
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
SuggestionsBuilder(string, int)
Accumulates replacements for the suffix of command input beginning at a fixed cursor.
public SuggestionsBuilder(string Input, int Start)Parameters
Input string
The complete command input.
Start int
The inclusive replacement start.
Properties
InputLowerCase
Gets the complete input converted to lowercase using the current culture.
public string InputLowerCase { get; }Property Value
Remaining
Gets the input suffix beginning at Start.
public string Remaining { get; }Property Value
RemainingLowerCase
Gets the lowercased input suffix beginning at Start.
public string RemainingLowerCase { get; }Property Value
Methods
Add(SuggestionsBuilder)
Appends every accumulated suggestion from another builder.
public SuggestionsBuilder Add(SuggestionsBuilder other)Parameters
other SuggestionsBuilder
The builder whose private results are copied.
Returns
This builder.
Build()
Builds normalized suggestions from the accumulated entries.
public Suggestions Build()Returns
The completed suggestions.
BuildAsync(CancellationToken)
Builds suggestions synchronously and wraps them in a completed asynchronous value.
public ValueTask<Suggestions> BuildAsync(CancellationToken _)Parameters
An unused cancellation token.
Returns
The completed suggestions.
CreateOffset(int)
Creates an empty builder for the same input at another replacement start.
public SuggestionsBuilder CreateOffset(int start)Parameters
start int
The new inclusive start.
Returns
The new builder.
Restart()
Creates an empty builder using this builder’s original start.
public SuggestionsBuilder Restart()Returns
The new builder.
Suggest(string)
Adds a text replacement unless it exactly equals the remaining input.
public SuggestionsBuilder Suggest(string text)Parameters
text string
The replacement text.
Returns
This builder.
Suggest(string, IMessage)
Adds a text replacement with a tooltip unless it exactly equals the remaining input.
public SuggestionsBuilder Suggest(string text, IMessage tooltip)Parameters
text string
The replacement text.
tooltip IMessage
The tooltip.
Returns
This builder.
Suggest(int)
Adds an integer replacement.
public SuggestionsBuilder Suggest(int value)Parameters
value int
The integer to format and suggest.
Returns
This builder.
Suggest(int, IMessage)
Adds an integer suggestion with an associated tooltip for the portion of the input from this builder’s start position to the end of the input.
public SuggestionsBuilder Suggest(int value, IMessage tooltip)Parameters
value int
The integer value to suggest.
tooltip IMessage
The message to associate with the suggestion as its tooltip.
Returns
This builder, allowing additional suggestions to be added.