C# Class SharpMod.CommandManager

A class for managing all the command associations
显示文件 Open project: txdv/sharpmod

Public Methods

Method Description
CreateCommand ( CommandType type, string arguments ) : Command
RegisterCommand ( Type type ) : void
RegisterCommandHandler ( string str, ClientCommandDelegate handler ) : void

Registers a ClientCommand handler to a specific command

Private Methods

Method Description
CommandManager ( ) : System
CreateCommandFromGameEngine ( CommandType type ) : Command

Creates a command class instance using the gameengine command calls

Execute ( Player player, Command cmd ) : void

This function is used internally. It executes all needed handlers when a specific command occures.

ServerCommandHandler ( string arguments ) : void

Method Details

CreateCommand() public static method

public static CreateCommand ( CommandType type, string arguments ) : Command
type CommandType
arguments string
return Command

RegisterCommand() public static method

public static RegisterCommand ( Type type ) : void
type System.Type
return void

RegisterCommandHandler() public static method

Registers a ClientCommand handler to a specific command
public static RegisterCommandHandler ( string str, ClientCommandDelegate handler ) : void
str string /// The beginning of the string to witch it has to match (for example "say /death") ///
handler ClientCommandDelegate /// A handler which to invoke if command occures ///
return void