Table of Contents

Class CommandCompleter

Namespace
BSGameLib.Chat
Assembly
BSGameLib.Chat.dll

Completes a command typed into a chat line, as Minecraft's chat does: the commands, then a group's commands, then each parameter's values where the game knows them, and the parts still to type shown as a hint. Words are separated by spaces and matched ignoring case.

public sealed class CommandCompleter
Inheritance
CommandCompleter
Inherited Members

Constructors

CommandCompleter(IReadOnlyList<CommandSpec>, char)

Creates a completer over commands. A line is completed only when it starts with commandCharacter.

public CommandCompleter(IReadOnlyList<CommandSpec> commands, char commandCharacter = '/')

Parameters

commands IReadOnlyList<CommandSpec>
commandCharacter char

Methods

Complete(string, Func<string, IReadOnlyList<string>, IReadOnlyList<string>>)

What can be typed at the end of line. values gives a parameter's values by the name its Suggestions holds and the parameters before it -- what the game knows now, which may be nothing yet.

public CompletionResult Complete(string line, Func<string, IReadOnlyList<string>, IReadOnlyList<string>> values = null)

Parameters

line string
values Func<string, IReadOnlyList<string>, IReadOnlyList<string>>

Returns

CompletionResult