Options
All
  • Public
  • Public/Protected
  • All
Menu

Used to track input and check against registered commands.

Hierarchy

  • CommandTracker

Index

Constructors

constructor

Properties

Protected commands

commands: Command[]

List of regestered commands. Add Command by using registerCommand.

current

current: string

Keeps track of partially done command from user.

history

history: string[]

History of commands entered.

Protected historyCounter

historyCounter: number

Keeps track of last command loaded using history.

historyMax

historyMax: number

The max number of commands recored by history. Defaults to 100. -1 will disable the limit.

Protected input

Input tracker for user keyboard input.

Protected output

OutputTerminal that is used to display the current state of input and output.

Methods

Protected addToCurrent

  • addToCurrent(key: string): void

Protected addToHistory

  • addToHistory(command: string): void

Protected backspaceCurrent

  • backspaceCurrent(key: string): void

finalizeCurrent

  • finalizeCurrent(key: string): void
  • Function run when 'Enter' is pressed. Will handle whatever command is in current, report unknown command, and reset for the next command.

    Parameters

    • key: string

    Returns void

helpCommand

Protected historyBack

  • historyBack(key: string): void

Protected historyForwards

  • historyForwards(key: string): void

Protected parseArguments

registerCommand

  • registerCommand(command: Command): void

Protected setupInput

  • setupInput(): void

update

  • update(): void

Static indexOfCommandArgument

Static indexOfCommandArguments

  • indexOfCommandArguments(argsToLookFor: string[], args: CommandArguments[]): number[]

Generated using TypeDoc