Table of Contents

Class CommandSyntaxFormatter

Namespace
Uncreated.Warfare.Interaction.Commands.Syntax
Assembly
Uncreated.Warfare.dll
public class CommandSyntaxFormatter : IDisposable
Inheritance
CommandSyntaxFormatter
Implements
Inherited Members

Constructors

CommandSyntaxFormatter(ISyntaxWriter, UserPermissionStore)

[ActivatorUtilitiesConstructor]
public CommandSyntaxFormatter(ISyntaxWriter syntaxWriter, UserPermissionStore permissionStore)

Parameters

syntaxWriter ISyntaxWriter
permissionStore UserPermissionStore

CommandSyntaxFormatter(ISyntaxWriter, UserPermissionStore?, string?, bool)

public CommandSyntaxFormatter(ISyntaxWriter syntaxWriter, UserPermissionStore? permissionStore, string? prefix, bool leaveOpen = false)

Parameters

syntaxWriter ISyntaxWriter
permissionStore UserPermissionStore
prefix string
leaveOpen bool

Fields

Verbatim

public const string Verbatim = "Verbatim"

Field Value

string

Properties

SyntaxWriter

public ISyntaxWriter SyntaxWriter { get; }

Property Value

ISyntaxWriter

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetRichDescription(ICommandParameterDescriptor, ICommandFlagDescriptor?, ISyntaxWriter, LanguageInfo?)

Enriches a description string with tags like caller, target, param, etc.

public string? GetRichDescription(ICommandParameterDescriptor parameter, ICommandFlagDescriptor? flag, ISyntaxWriter writer, LanguageInfo? language)

Parameters

parameter ICommandParameterDescriptor
flag ICommandFlagDescriptor
writer ISyntaxWriter
language LanguageInfo

Returns

string

GetSyntaxString(ICommandDescriptor, IReadOnlyList<string>, string?, ICommandUser?, string?, CancellationToken)

Creates a syntax string that describes the requires arguments from the meta file.

public ValueTask<CommandSyntaxFormatter.SyntaxStringInfo> GetSyntaxString(ICommandDescriptor command, IReadOnlyList<string> args, string? flag, ICommandUser? user, string? aliasOverride = null, CancellationToken token = default)

Parameters

command ICommandDescriptor
args IReadOnlyList<string>
flag string
user ICommandUser
aliasOverride string
token CancellationToken

Returns

ValueTask<CommandSyntaxFormatter.SyntaxStringInfo>

Exceptions

ArgumentNullException