C# Class SharpMod.Command

A class for handling commands send by the players
Datei anzeigen Open project: txdv/sharpmod Class Usage Examples

Public Methods

Method Description
Command ( string arguments ) : System

Constructor of the class

Execute ( Player player ) : void
FakeCall ( Player p ) : void

Emulates a player calling a command.

ToString ( ) : string

A string representation of the class. Returns a online command string, which could be written into the console.

Protected Methods

Method Description
OnFailure ( Player player ) : void
OnFailure ( int userid ) : void
OnFailure ( int userid, Exception exception ) : void
OnFailure ( int userid, string errorMessage ) : void
OnSuccess ( Player player ) : void
OnSuccess ( int userid ) : void
Write ( Player player, string text ) : void
WriteLine ( Player player, string text ) : void

Private Methods

Method Description
Escape ( string text ) : string

Method Details

Command() public method

Constructor of the class
public Command ( string arguments ) : System
arguments string /// A managed array with the arguments ///
return System

Execute() public method

public Execute ( Player player ) : void
player Player
return void

FakeCall() public method

Emulates a player calling a command.
public FakeCall ( Player p ) : void
p Player /// Instance of the player ///
return void

OnFailure() protected method

protected OnFailure ( Player player ) : void
player Player
return void

OnFailure() protected method

protected OnFailure ( int userid ) : void
userid int
return void

OnFailure() protected method

protected OnFailure ( int userid, Exception exception ) : void
userid int
exception System.Exception
return void

OnFailure() protected method

protected OnFailure ( int userid, string errorMessage ) : void
userid int
errorMessage string
return void

OnSuccess() protected method

protected OnSuccess ( Player player ) : void
player Player
return void

OnSuccess() protected method

protected OnSuccess ( int userid ) : void
userid int
return void

ToString() public method

A string representation of the class. Returns a online command string, which could be written into the console.
public ToString ( ) : string
return string

Write() protected static method

protected static Write ( Player player, string text ) : void
player Player
text string
return void

WriteLine() protected static method

protected static WriteLine ( Player player, string text ) : void
player Player
text string
return void