Skip to content

Class Suggestions

Namespace: Void.Minecraft.Commands.Brigadier.Suggestion
Assembly: Void.Minecraft.dll

Contains normalized, sorted suggestions sharing a replacement range.

public record Suggestions : IEquatable<Suggestions>

Inheritance

objectSuggestions

Implements

IEquatable<Suggestions>

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

Suggestions(StringRange, List<Suggestion>)

Contains normalized, sorted suggestions sharing a replacement range.

public Suggestions(StringRange Range, List<Suggestion> All)

Parameters

Range StringRange

The common replacement range.

All List<Suggestion>

The suggestion list.

Properties

All

The suggestion list.

public List<Suggestion> All { get; init; }

Property Value

List<Suggestion>

Empty

Gets the shared empty suggestion result at position zero.

public static Suggestions Empty { get; }

Property Value

Suggestions

IsEmpty

Gets whether the list contains no suggestions.

public bool IsEmpty { get; }

Property Value

bool

Range

The common replacement range.

public StringRange Range { get; init; }

Property Value

StringRange

Methods

Create(string, IEnumerable<Suggestion>)

Deduplicates, range-normalizes, and ordinally sorts suggestions.

public static Suggestions Create(string command, IEnumerable<Suggestion> suggestions)

Parameters

command string

The complete command input.

suggestions IEnumerable<Suggestion>

The suggestions to normalize.

Returns

Suggestions

The normalized result, or for no suggestions.

EmptyAsync()

Returns the shared empty result as a completed asynchronous value.

public static ValueTask<Suggestions> EmptyAsync()

Returns

ValueTask<Suggestions>

A completed value containing .

Merge(string, IEnumerable<Suggestions>)

Merges suggestion sets and normalizes their replacement ranges.

public static Suggestions Merge(string command, IEnumerable<Suggestions> input)

Parameters

command string

The complete command input.

input IEnumerable<Suggestions>

The suggestion sets.

Returns

Suggestions

The empty result, the sole input instance, or a merged result.