### Hierarchy

- BaseUI
  - TerminalUI

## Index

### Constructors

- constructor

### Properties

- PIXEL_HEIGHT
- PIXEL_WIDTH
- SPRITE_HEIGHT
- SPRITE_WIDTH
- engine
- gameData
- hasVisualUi
- inspectorCol
- inspectorRow
- isDumpingScreen
- renderedPixels
- windowOffsetColStart
- windowOffsetHeight
- windowOffsetRowStart
- windowOffsetWidth

### Methods

- _drawPixel
- a11yWrite
- canShowMessageAsCells
- cellPosToXY
- checkIfCellCanBeDrawnOnScreen
- clearScreen
- createMessageSprites
- createMessageTextScreen
- debugRenderScreen
- destroy
- drawCells
- drawCellsAfterRecentering
- dumpScreen
- getCurrentLevelCells
- getGameData
- getHasVisualUi
- getMaxSize
- getPixelsForCell
- hasAgainThatNeedsToRun
- moveInspector
- moveInspectorTo
- press
- pressAction
- pressDown
- pressLeft
- pressRestart
- pressRight
- pressUndo
- pressUp
- renderLevelScreen
- renderMessageScreen
- renderScreen
- setGame
- setGameEngine
- setHasVisualUi
- setLevel
- setPixel
- setSmallTerminal
- tick
- willAllLevelsFitOnScreen
- writeDebug

## Constructors

### constructor

- new TerminalUI(): TerminalUI

- Overrides BaseUI.constructor

  - Defined in ui/terminal.ts:73

  #### Returns TerminalUI

## Properties

### PIXEL_HEIGHT

PIXEL_HEIGHT: number

Inherited from BaseUI.PIXEL_HEIGHT

- Defined in ui/base.ts:87

### PIXEL_WIDTH

PIXEL_WIDTH: number

Inherited from BaseUI.PIXEL_WIDTH

- Defined in ui/base.ts:86

### Protected SPRITE_HEIGHT

SPRITE_HEIGHT: number

Inherited from BaseUI.SPRITE_HEIGHT

- Defined in ui/base.ts:97

### Protected SPRITE_WIDTH

SPRITE_WIDTH: number

Inherited from BaseUI.SPRITE_WIDTH

- Defined in ui/base.ts:96

### Protected engine

engine: Optional<GameEngine>

Inherited from BaseUI.engine

- Defined in ui/base.ts:89

### Protected gameData

gameData: Optional<GameData>

Inherited from BaseUI.gameData

- Defined in ui/base.ts:88

### Protected hasVisualUi

hasVisualUi: boolean

Inherited from BaseUI.hasVisualUi

- Defined in ui/base.ts:98

### Protected inspectorCol

inspectorCol: number

- Defined in ui/terminal.ts:70

### Protected inspectorRow

inspectorRow: number

- Defined in ui/terminal.ts:71

### Protected isDumpingScreen

isDumpingScreen: boolean

Inherited from BaseUI.isDumpingScreen

- Defined in ui/base.ts:95

### Protected renderedPixels

renderedPixels: Array<Array<object>>

Inherited from BaseUI.renderedPixels

- Defined in ui/base.ts:90

### Protected windowOffsetColStart

windowOffsetColStart: number

Inherited from BaseUI.windowOffsetColStart

- Defined in ui/base.ts:91

### Protected windowOffsetHeight

windowOffsetHeight: Optional<number>

Inherited from BaseUI.windowOffsetHeight

- Defined in ui/base.ts:94

### Protected windowOffsetRowStart

windowOffsetRowStart: number

Inherited from BaseUI.windowOffsetRowStart

- Defined in ui/base.ts:92

### Protected windowOffsetWidth

windowOffsetWidth: Optional<number>

Inherited from BaseUI.windowOffsetWidth

- Defined in ui/base.ts:93

## Methods

### _drawPixel

- _drawPixel(x: number, y: number, fgHex: string, bgHex: Optional<string>, chars: string): void

- - Defined in ui/terminal.ts:254

  #### Parameters

  - ##### x: number

  - ##### y: number

  - ##### fgHex: string

  - ##### bgHex: Optional<string>

  - ##### chars: string

  #### Returns void

### a11yWrite

- a11yWrite(text: string): void

- - Defined in ui/terminal.ts:214

  #### Parameters

  - ##### text: string

  #### Returns void

### canShowMessageAsCells

- canShowMessageAsCells(): boolean

- - Defined in ui/terminal.ts:169

  #### Returns boolean

### Protected cellPosToXY

- cellPosToXY(cell: Cell): object

- Inherited from BaseUI.cellPosToXY

  - Defined in ui/base.ts:431

  #### Parameters

  - ##### cell: Cell

  #### Returns object

  - ##### cellStartX: number

  - ##### cellStartY: number

  - ##### isOnScreen: boolean

### Protected checkIfCellCanBeDrawnOnScreen

- checkIfCellCanBeDrawnOnScreen(cellStartX: number, cellStartY: number): boolean

- Overrides BaseUI.checkIfCellCanBeDrawnOnScreen

  - Defined in ui/terminal.ts:438

  #### Parameters

  - ##### cellStartX: number

  - ##### cellStartY: number

  #### Returns boolean

### clearScreen

- clearScreen(): void

- Overrides BaseUI.clearScreen

  - Defined in ui/terminal.ts:124

  #### Returns void

### Protected createMessageSprites

- createMessageSprites(messageStr: string): Set<GameSprite>[][]

- Inherited from BaseUI.createMessageSprites

  - Defined in ui/base.ts:403

  #### Parameters

  - ##### messageStr: string

  #### Returns Set<GameSprite>[][]

### Protected createMessageTextScreen

- createMessageTextScreen(messageStr: string): string[]

- Inherited from BaseUI.createMessageTextScreen

  - Defined in ui/base.ts:332

  #### Parameters

  - ##### messageStr: string

  #### Returns string[]

### debugRenderScreen

- debugRenderScreen(): void

- Inherited from BaseUI.debugRenderScreen

  - Defined in ui/base.ts:243

  #### Returns void

### destroy

- destroy(): void

- Overrides BaseUI.destroy

  - Defined in ui/terminal.ts:100

  #### Returns void

### drawCells

- drawCells(cells: Iterable<Cell>, dontRestoreCursor: boolean, renderScreenDepth?: number): void

- Inherited from BaseUI.drawCells

  - Defined in ui/base.ts:301

  #### Parameters

  - ##### cells: Iterable<Cell>

  - ##### dontRestoreCursor: boolean

  - ##### Default value renderScreenDepth: number = 0

  #### Returns void

### Protected drawCellsAfterRecentering

- drawCellsAfterRecentering(cells: Iterable<Cell>, renderScreenDepth: number): void

- Overrides BaseUI.drawCellsAfterRecentering

  - Defined in ui/terminal.ts:427

  #### Parameters

  - ##### cells: Iterable<Cell>

  - ##### renderScreenDepth: number

  #### Returns void

### dumpScreen

- dumpScreen(): void

- - Defined in ui/terminal.ts:143

  #### Returns void

### getCurrentLevelCells

- getCurrentLevelCells(): Cell[][]

- Inherited from BaseUI.getCurrentLevelCells

  - Defined in ui/base.ts:209

  #### Returns Cell[][]

### getGameData

- getGameData(): GameData

- Inherited from BaseUI.getGameData

  - Defined in ui/base.ts:167

  #### Returns GameData

### getHasVisualUi

- getHasVisualUi(): boolean

- - Defined in ui/terminal.ts:108

  #### Returns boolean

### Protected getMaxSize

- getMaxSize(): object

- Overrides BaseUI.getMaxSize

  - Defined in ui/terminal.ts:451

  #### Returns object

  - ##### columns: number

  - ##### rows: number

### Protected getPixelsForCell

- getPixelsForCell(cell: Cell): IColor[][]

- Inherited from BaseUI.getPixelsForCell

  - Defined in ui/base.ts:463

  #### Parameters

  - ##### cell: Cell

  #### Returns IColor[][]

### Protected hasAgainThatNeedsToRun

- hasAgainThatNeedsToRun(): boolean

- Inherited from BaseUI.hasAgainThatNeedsToRun

  - Defined in ui/base.ts:484

  #### Returns boolean

### moveInspector

- moveInspector(direction: RULE_DIRECTION): void

- - Defined in ui/terminal.ts:303

  #### Parameters

  - ##### direction: RULE_DIRECTION

  #### Returns void

### moveInspectorTo

- moveInspectorTo(cell: Cell): void

- - Defined in ui/terminal.ts:258

  #### Parameters

  - ##### cell: Cell

  #### Returns void

### press

- press(dir: RULE_DIRECTION): void

- Inherited from BaseUI.press

  - Defined in ui/base.ts:174

  #### Parameters

  - ##### dir: RULE_DIRECTION

  #### Returns void

### pressAction

- pressAction(): void

- Inherited from BaseUI.pressAction

  - Defined in ui/base.ts:191

  #### Returns void

### pressDown

- pressDown(): void

- Inherited from BaseUI.pressDown

  - Defined in ui/base.ts:182

  #### Returns void

### pressLeft

- pressLeft(): void

- Inherited from BaseUI.pressLeft

  - Defined in ui/base.ts:185

  #### Returns void

### pressRestart

- pressRestart(): void

- Inherited from BaseUI.pressRestart

  - Defined in ui/base.ts:199

  #### Returns void

### pressRight

- pressRight(): void

- Inherited from BaseUI.pressRight

  - Defined in ui/base.ts:188

  #### Returns void

### pressUndo

- pressUndo(): void

- Inherited from BaseUI.pressUndo

  - Defined in ui/base.ts:194

  #### Returns void

### pressUp

- pressUp(): void

- Inherited from BaseUI.pressUp

  - Defined in ui/base.ts:179

  #### Returns void

### Protected renderLevelScreen

- renderLevelScreen(levelRows: Cell[][], renderScreenDepth: number): void

- Overrides BaseUI.renderLevelScreen

  - Defined in ui/terminal.ts:316

  #### Parameters

  - ##### levelRows: Cell[][]

  - ##### renderScreenDepth: number

  #### Returns void

### renderMessageScreen

- renderMessageScreen(message: string): void

- Overrides BaseUI.renderMessageScreen

  - Defined in ui/terminal.ts:180

  #### Parameters

  - ##### message: string

  #### Returns void

### renderScreen

- renderScreen(clearCaches: boolean, renderScreenDepth?: number): void

- Inherited from BaseUI.renderScreen

  - Defined in ui/base.ts:276

  #### Parameters

  - ##### clearCaches: boolean

  - ##### Default value renderScreenDepth: number = 0

  #### Returns void

### setGame

- setGame(gameData: string): void

- Inherited from BaseUI.setGame

  - Defined in ui/base.ts:160

  #### Parameters

  - ##### gameData: string

  #### Returns void

### setGameEngine

- setGameEngine(engine: GameEngine): void

- Inherited from BaseUI.setGameEngine

  - Defined in ui/base.ts:129

  #### Parameters

  - ##### engine: GameEngine

  #### Returns void

### setHasVisualUi

- setHasVisualUi(flag: boolean): void

- - Defined in ui/terminal.ts:111

  #### Parameters

  - ##### flag: boolean

  #### Returns void

### setLevel

- setLevel(levelNum: number): void

- Inherited from BaseUI.setLevel

  - Defined in ui/base.ts:204

  #### Parameters

  - ##### levelNum: number

  #### Returns void

### Protected setPixel

- setPixel(x: number, y: number, hex: string, fgHex: Optional<string>, chars: string): string

- Overrides BaseUI.setPixel

  - Defined in ui/terminal.ts:380

  #### Parameters

  - ##### x: number

  - ##### y: number

  - ##### hex: string

  - ##### fgHex: Optional<string>

  - ##### chars: string

  #### Returns string

### setSmallTerminal

- setSmallTerminal(yesNo: boolean): void

- - Defined in ui/terminal.ts:114

  #### Parameters

  - ##### yesNo: boolean

  #### Returns void

### tick

- tick(): ITickResult

- Inherited from BaseUI.tick

  - Defined in ui/base.ts:216

  #### Returns ITickResult

### willAllLevelsFitOnScreen

- willAllLevelsFitOnScreen(gameData: GameData): boolean

- - Defined in ui/terminal.ts:222

  #### Parameters

  - ##### gameData: GameData

  #### Returns boolean

### writeDebug

- writeDebug(text: string, category: number): void

- - Defined in ui/terminal.ts:202

  #### Parameters

  - ##### text: string

  - ##### category: number

  #### Returns void

Generated using TypeDoc