C# Class fCraft.CommandManager

Static class that allows registration and parsing of all text commands.
Afficher le fichier Open project: GlennMR/800craft Class Usage Examples

Méthodes publiques

Свойство Type Description
ReservedCommandNames string[]

Méthodes publiques

Méthode Description
GetCommands ( ) : fCraft.CommandDescriptor[]

Gets a list of all commands (includding hidden ones).

GetCommands ( CommandCategory category, bool includeHidden ) : fCraft.CommandDescriptor[]

Gets a list of commands in a specified category. Note that commands may belong to more than one category.

GetCommands ( [ rank, bool includeHidden ) : fCraft.CommandDescriptor[]

Gets a list of commands available to a specified rank.

GetCommands ( bool hidden ) : fCraft.CommandDescriptor[]

Gets a list of ONLY hidden or non-hidden commands, not both.

Init ( ) : void
IsValidCommandName ( [ name ) : bool

Checks whether a command name is acceptible. Constraints are similar to Player.IsValidName, except for minimum length.

ParseCommand ( [ player, [ cmd, bool fromConsole ) : bool

Parses and calls a specified command.

RegisterCustomCommand ( [ descriptor ) : void

Registers a custom command with fCraft. CommandRegistrationException may be thrown if the given descriptor does not meet all the requirements.

Private Methods

Méthode Description
GetDescriptor ( [ commandName, bool alsoCheckAliases ) : CommandDescriptor
RaiseCommandCalledEvent ( Command cmd, CommandDescriptor descriptor, Player player ) : void
RaiseCommandCallingEvent ( Command cmd, CommandDescriptor descriptor, Player player ) : bool
RaiseCommandRegisteredEvent ( CommandDescriptor descriptor ) : void
RaiseCommandRegisteringEvent ( CommandDescriptor descriptor ) : bool
RegisterCommand ( [ descriptor ) : void

Method Details

GetCommands() public static méthode

Gets a list of all commands (includding hidden ones).
public static GetCommands ( ) : fCraft.CommandDescriptor[]
Résultat fCraft.CommandDescriptor[]

GetCommands() public static méthode

Gets a list of commands in a specified category. Note that commands may belong to more than one category.
public static GetCommands ( CommandCategory category, bool includeHidden ) : fCraft.CommandDescriptor[]
category CommandCategory
includeHidden bool
Résultat fCraft.CommandDescriptor[]

GetCommands() public static méthode

Gets a list of commands available to a specified rank.
public static GetCommands ( [ rank, bool includeHidden ) : fCraft.CommandDescriptor[]
rank [
includeHidden bool
Résultat fCraft.CommandDescriptor[]

GetCommands() public static méthode

Gets a list of ONLY hidden or non-hidden commands, not both.
public static GetCommands ( bool hidden ) : fCraft.CommandDescriptor[]
hidden bool
Résultat fCraft.CommandDescriptor[]

Init() public static méthode

public static Init ( ) : void
Résultat void

IsValidCommandName() public static méthode

Checks whether a command name is acceptible. Constraints are similar to Player.IsValidName, except for minimum length.
public static IsValidCommandName ( [ name ) : bool
name [ Command name to check.
Résultat bool

ParseCommand() public static méthode

Parses and calls a specified command.
public static ParseCommand ( [ player, [ cmd, bool fromConsole ) : bool
player [ Player who issued the command.
cmd [ Command to be parsed and executed.
fromConsole bool Whether this command is being called from a non-player (e.g. Console).
Résultat bool

RegisterCustomCommand() public static méthode

Registers a custom command with fCraft. CommandRegistrationException may be thrown if the given descriptor does not meet all the requirements.
public static RegisterCustomCommand ( [ descriptor ) : void
descriptor [
Résultat void

Property Details

ReservedCommandNames public_oe static_oe property

public static string[] ReservedCommandNames
Résultat string[]