C# Class RohBot.Command

Exibir arquivo Open project: Rohansi/RohBot Class Usage Examples

Public Methods

Method Description
Format ( CommandTarget target, string type ) : string

Return a parameter format string. '-' is a short parameter and ']' uses remaining space. Returns null if it can not handle type. Target and type can be ignored if this is not a default handler. Examples: "" = No parameters "-" = One short parameter (word or text enclosed in double quotes) "]" = One parameter containing all text after Type "--]" = Two short parameters and one parameter containing the leftovers

Handle ( CommandTarget target, string message, string commandHeader ) : bool
Handle ( CommandTarget target, string type, string parameters ) : void

Called when somebody uses this command. Type can be ignored if this is not a default handler.

Private Methods

Method Description
Command ( ) : System
ReadRemaining ( StringReader reader ) : string
ReadWord ( StringReader reader ) : string
SkipWhiteSpace ( StringReader reader ) : void

Method Details

Format() public abstract method

Return a parameter format string. '-' is a short parameter and ']' uses remaining space. Returns null if it can not handle type. Target and type can be ignored if this is not a default handler. Examples: "" = No parameters "-" = One short parameter (word or text enclosed in double quotes) "]" = One parameter containing all text after Type "--]" = Two short parameters and one parameter containing the leftovers
public abstract Format ( CommandTarget target, string type ) : string
target CommandTarget
type string
return string

Handle() public static method

public static Handle ( CommandTarget target, string message, string commandHeader ) : bool
target CommandTarget
message string
commandHeader string
return bool

Handle() public abstract method

Called when somebody uses this command. Type can be ignored if this is not a default handler.
public abstract Handle ( CommandTarget target, string type, string parameters ) : void
target CommandTarget
type string
parameters string
return void