C# Class MBC.App.BattleshipConsole.Input

The main part of the AppConsole that stores command strings that are associated with MBCShellCommandHandlers, which perform specific tasks. The strings that are input are then parsed to invoke the stored commands.

The commands modify the internal state of this particular class, specifically storing the controllers that are available.

Datei anzeigen Open project: aiclub/Mohawk_Battleship

Public Methods

Method Description
AddCommand ( MBCShellCommandHandler handler ) : void

Associates a number of newCmds to a handler.

RunCommand ( ) : bool

Runs a command, or a series of commands separated by a pipe "|" and passes the current index of the array of strings to the command handler to parse parameters when needed.

RunCommand ( string input ) : bool

Splits a string by whitespaces without splitting the strings encapsulated with double-quotes. Runs the Input.RunCommand(string[]) method with the parsed input.

Private Methods

Method Description
Input ( ) : System
Main ( string args ) : void

AppConsole entry point

Stop ( int idx ) : void

Stops input.

Method Details

AddCommand() public static method

Associates a number of newCmds to a handler.
public static AddCommand ( MBCShellCommandHandler handler ) : void
handler MBCShellCommandHandler The method to invoke from
return void

RunCommand() public static method

Runs a command, or a series of commands separated by a pipe "|" and passes the current index of the array of strings to the command handler to parse parameters when needed.
public static RunCommand ( ) : bool
return bool

RunCommand() public static method

Splits a string by whitespaces without splitting the strings encapsulated with double-quotes. Runs the Input.RunCommand(string[]) method with the parsed input.
public static RunCommand ( string input ) : bool
input string A string of input.
return bool