C# Class MBC.App.Terminal.BattleshipConsole

Afficher le fichier Open project: aiclub/Mohawk_Battleship

Méthodes publiques

Méthode Description
AddModule ( TerminalModule mod ) : void

Adds a TerminalModule object to this BattleshipConsole for displaying.

RemoveModule ( TerminalModule mod ) : void

Removes a TerminalModule object from this BattleshipConsole.

UpdateDisplay ( ) : void

Refreshes the entire terminal buffer. Use after adding/removing modules.

Private Methods

Méthode Description
HandleKeyControl ( ConsoleKeyInfo cki ) : bool

Used for selecting a buffer via arrow keys + CTRL. Also moves the order of TerminalModules in this BattleshipConsole with arrow keys + CTRL + SHIFT. Does not do anything and returns false if CTRL is not pressed.

Main ( string args ) : void
ProcessInputLine ( ConsoleKeyInfo key ) : bool

Processes a key press and modifies the input string with valid characters.

RecalculateBounds ( ) : void

Calculates the boundaries of the generated number of rows and columns used for displaying the TerminalModules based on the size of the terminal window.

UpdateInputLineDisplay ( bool complete ) : void

Updates the display of the input line on the terminal window. Optionally updates just the input string that the user has entered instead of the entire line.

WriteGridLines ( ) : void

Makes the grid lines that identify each module displayed on the terminal.

Method Details

AddModule() public static méthode

Adds a TerminalModule object to this BattleshipConsole for displaying.
public static AddModule ( TerminalModule mod ) : void
mod MBC.App.Terminal.Modules.TerminalModule
Résultat void

RemoveModule() public static méthode

Removes a TerminalModule object from this BattleshipConsole.
public static RemoveModule ( TerminalModule mod ) : void
mod MBC.App.Terminal.Modules.TerminalModule
Résultat void

UpdateDisplay() public static méthode

Refreshes the entire terminal buffer. Use after adding/removing modules.
public static UpdateDisplay ( ) : void
Résultat void