C# Class PolaMUD.Parser

ファイルを表示 Open project: Polatrite/PolaMUD

Public Methods

Method Description
GetArgument ( string line, int index ) : PolaMUD.Argument

Retrieves the appropriate argument from the given input string, optionally retrieving an object reference based on what you're looking for (Player, Room, etc.)

GetArgument ( string line, int index, Mob user, Type reference, int searchLocation ) : PolaMUD.Argument

Retrieves tshe appropriate Argument from the given input string. Argument's reference object is automatically retrieved based on the Type and SearchLocations enumeration provided.

GetStringArgument ( string line, int index ) : PolaMUD.Argument

Retrieves a string argument from the given input string. This argument should always be the last argument in the line, as this will retrieve the rest of the input string after all previous arguments.

Interpret ( PolaMUD.TelnetConnection conn, string line ) : void

Thread-safe callback from each TelnetConnection, parsing input. This function is timed internally by PulseTimer().

Private Methods

Method Description
GetArgumentString ( string line, int index, bool takeAll ) : string

This returns the string that composes an entire argument, including handling prefixes such as 3. or 5* This is for internal use. External calls to the parser should use GetArgument.

Method Details

GetArgument() public static method

Retrieves the appropriate argument from the given input string, optionally retrieving an object reference based on what you're looking for (Player, Room, etc.)
public static GetArgument ( string line, int index ) : PolaMUD.Argument
line string The input string
index int The index of the desired argument (1 is always the command itself)
return PolaMUD.Argument

GetArgument() public static method

Retrieves tshe appropriate Argument from the given input string. Argument's reference object is automatically retrieved based on the Type and SearchLocations enumeration provided.
public static GetArgument ( string line, int index, Mob user, Type reference, int searchLocation ) : PolaMUD.Argument
line string The input string
index int The index of the desired argument (1 is always the command itself)
user Mob The user Mob, for retrieving references based on this Mob's state
reference System.Type The Type to search for (Mob, Player, etc.)
searchLocation int A SearchLocations enumeration to use in finding the reference
return PolaMUD.Argument

GetStringArgument() public static method

Retrieves a string argument from the given input string. This argument should always be the last argument in the line, as this will retrieve the rest of the input string after all previous arguments.
public static GetStringArgument ( string line, int index ) : PolaMUD.Argument
line string The input string
index int The index of the desired argument (1 is always the command itself)
return PolaMUD.Argument

Interpret() public static method

Thread-safe callback from each TelnetConnection, parsing input. This function is timed internally by PulseTimer().
public static Interpret ( PolaMUD.TelnetConnection conn, string line ) : void
conn PolaMUD.TelnetConnection The TelnetConnection the input is coming from
line string The input string
return void