fCraft  0.636
Custom Minecraft Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events
Public Member Functions | Properties | List of all members
fCraft.CommandDescriptor Class Reference

Describes a chat command. Defines properties, permission requirements, and usage information. Specifies a handler method. More...

Inheritance diagram for fCraft.CommandDescriptor:
Inheritance graph
[legend]
Collaboration diagram for fCraft.CommandDescriptor:
Collaboration graph
[legend]

Public Member Functions

bool CanBeCalledBy ([NotNull] Rank rank)
 Checks whether this command may be called by players of a given rank.
 
bool IsVisibleTo ([NotNull] Rank rank)
 Checks whether players of the given rank should see this command in /cmds list. Takes permissions and the hidden flag into account.
 
void PrintUsage ([NotNull] Player player)
 Prints command usage syntax to the given player.
 
bool Call ([NotNull] Player player,[NotNull] CommandReader cmd, bool raiseEvent)
 Calls this command.
 
override string ToString ()
 

Properties

string[] Aliases [get, set]
 List of aliases. May be null or empty. Default: null
 
CommandCategory Category [get, set]
 Command category. Must be set before registering.
 
bool IsConsoleSafe [get, set]
 Whether the command may be used from console. Default: false
 
CommandHandler Handler [get, set]
 Callback function to execute when command is called. Must be set before registering.
 
string Help [get, set]
 Full text of the help message. Default: null
 
bool IsHidden [get, set]
 Whether the command is hidden from command list (/cmds). Default: false
 
bool IsCustom [get, set]
 Whether the command is not part of fCraft core (set automatically).
 
bool NotRepeatable [get, set]
 Whether the command should be repeated by the "/" shortcut. Default: false
 
bool UsableByFrozenPlayers [get, set]
 Whether the command should be usable by frozen players. Default: false
 
bool DisableLogging [get, set]
 Whether calls to this command should not be logged.
 
string Name [get, set]
 Primary command name. Must be set before registering.
 
Permission[] Permissions [get, set]
 List of permissions required to call the command. May be empty or null. Default: null
 
bool AnyPermission [get, set]
 Whether any permission from the list is enough. If this is false, ALL permissions are required.
 
string Usage [get, set]
 Brief demonstration of command's usage syntax. Defaults to "/Name".
 
Dictionary< string, string > HelpSections [get, set]
 Help sub-sections.
 
bool RepeatableSelection [get, set]
 Whether this command involves a selection that can be repeated with /static. Default: false
 
Rank MinRank [get]
 Gets the lowest rank that has any/all permissions to call this command. Returns null if none of the ranks have necessary permissions.
 
string ClassyName [get]
 Returns a formatted name of the command, colored and possibly prefixed according to MinRank requried to call this command.
 
- Properties inherited from fCraft.IClassy
string ClassyName [get]
 Name optionally formatted with minecraft color codes or other decorations.
 

Detailed Description

Describes a chat command. Defines properties, permission requirements, and usage information. Specifies a handler method.

Member Function Documentation

bool fCraft.CommandDescriptor.Call ( [NotNull] Player  player,
[NotNull] CommandReader  cmd,
bool  raiseEvent 
)

Calls this command.

Parameters
playerPlayer who called the command.
cmdCommand arguments.
raiseEventWhether CommandCalling and CommandCalled events should be raised.
Returns
True if the command was called succesfully. False if the call was cancelled by the CommandCalling event.
bool fCraft.CommandDescriptor.CanBeCalledBy ( [NotNull] Rank  rank)

Checks whether this command may be called by players of a given rank.

bool fCraft.CommandDescriptor.IsVisibleTo ( [NotNull] Rank  rank)

Checks whether players of the given rank should see this command in /cmds list. Takes permissions and the hidden flag into account.

void fCraft.CommandDescriptor.PrintUsage ( [NotNull] Player  player)

Prints command usage syntax to the given player.

override string fCraft.CommandDescriptor.ToString ( )

Property Documentation

string [] fCraft.CommandDescriptor.Aliases
getset

List of aliases. May be null or empty. Default: null

bool fCraft.CommandDescriptor.AnyPermission
getset

Whether any permission from the list is enough. If this is false, ALL permissions are required.

CommandCategory fCraft.CommandDescriptor.Category
getset

Command category. Must be set before registering.

string fCraft.CommandDescriptor.ClassyName
get

Returns a formatted name of the command, colored and possibly prefixed according to MinRank requried to call this command.

bool fCraft.CommandDescriptor.DisableLogging
getset

Whether calls to this command should not be logged.

CommandHandler fCraft.CommandDescriptor.Handler
getset

Callback function to execute when command is called. Must be set before registering.

string fCraft.CommandDescriptor.Help
getset

Full text of the help message. Default: null

Dictionary<string, string> fCraft.CommandDescriptor.HelpSections
getset

Help sub-sections.

bool fCraft.CommandDescriptor.IsConsoleSafe
getset

Whether the command may be used from console. Default: false

bool fCraft.CommandDescriptor.IsCustom
getset

Whether the command is not part of fCraft core (set automatically).

bool fCraft.CommandDescriptor.IsHidden
getset

Whether the command is hidden from command list (/cmds). Default: false

Rank fCraft.CommandDescriptor.MinRank
get

Gets the lowest rank that has any/all permissions to call this command. Returns null if none of the ranks have necessary permissions.

string fCraft.CommandDescriptor.Name
getset

Primary command name. Must be set before registering.

bool fCraft.CommandDescriptor.NotRepeatable
getset

Whether the command should be repeated by the "/" shortcut. Default: false

Permission [] fCraft.CommandDescriptor.Permissions
getset

List of permissions required to call the command. May be empty or null. Default: null

bool fCraft.CommandDescriptor.RepeatableSelection
getset

Whether this command involves a selection that can be repeated with /static. Default: false

bool fCraft.CommandDescriptor.UsableByFrozenPlayers
getset

Whether the command should be usable by frozen players. Default: false

string fCraft.CommandDescriptor.Usage
getset

Brief demonstration of command's usage syntax. Defaults to "/Name".


The documentation for this class was generated from the following file: