Maintains the state of the game. Here is an example flow:

    const engine = new GameEngine(gameData)
    engine.setLevel(0)
    engine.pressRight()
    engine.tick()
    engine.tick()
    engine.pressUp()
    engine.tick()
    engine.pressUndo()
    engine.tick()

### Hierarchy

- GameEngine

## Index

### Constructors

- constructor

### Methods

- canUndo
- getCurrentLevel
- getCurrentLevelCells
- getCurrentLevelNum
- getGameData
- getSpriteSize
- hasAgain
- loadSnapshotFromJSON
- on
- press
- pressAction
- pressDown
- pressLeft
- pressRestart
- pressRight
- pressUndo
- pressUp
- restoreFromMessageLevel
- saveSnapshotToJSON
- setLevel
- setMessageLevel
- tick

## Constructors

### constructor

- new GameEngine(gameData: GameData): GameEngine

- - Defined in engine.ts:848

  #### Parameters

  - ##### gameData: GameData

  #### Returns GameEngine

## Methods

### canUndo

- canUndo(): boolean

- - Defined in engine.ts:875

  #### Returns boolean

### getCurrentLevel

- getCurrentLevel(): ILevel

- - Defined in engine.ts:866

  #### Returns ILevel

### getCurrentLevelCells

- getCurrentLevelCells(): Cell[][]

- - Defined in engine.ts:863

  #### Returns Cell[][]

### getCurrentLevelNum

- getCurrentLevelNum(): number

- - Defined in engine.ts:869

  #### Returns number

### getGameData

- getGameData(): GameData

- - Defined in engine.ts:860

  #### Returns GameData

### getSpriteSize

- getSpriteSize(): object

- - Defined in engine.ts:1025

  #### Returns object

  - ##### spriteHeight: number

  - ##### spriteWidth: number

### hasAgain

- hasAgain(): boolean

- - Defined in engine.ts:872

  #### Returns boolean

### loadSnapshotFromJSON

- loadSnapshotFromJSON(json: CellSaveState): void

- - Defined in engine.ts:1033

  #### Parameters

  - ##### json: CellSaveState

  #### Returns void

### on

- on(eventName: string, handler: ILoadingProgressHandler): void

- - Defined in engine.ts:857

  #### Parameters

  - ##### eventName: string

  - ##### handler: ILoadingProgressHandler

  #### Returns void

### press

- press(direction: RULE_DIRECTION): void

- - Defined in engine.ts:996

  #### Parameters

  - ##### direction: RULE_DIRECTION

  #### Returns void

### pressAction

- pressAction(): void

- - Defined in engine.ts:1011

  #### Returns void

### pressDown

- pressDown(): void

- - Defined in engine.ts:1002

  #### Returns void

### pressLeft

- pressLeft(): void

- - Defined in engine.ts:1005

  #### Returns void

### pressRestart

- pressRestart(): void

- - Defined in engine.ts:1015

  #### Returns void

### pressRight

- pressRight(): void

- - Defined in engine.ts:1008

  #### Returns void

### pressUndo

- pressUndo(): void

- - Defined in engine.ts:1019

  #### Returns void

### pressUp

- pressUp(): void

- - Defined in engine.ts:999

  #### Returns void

### restoreFromMessageLevel

- restoreFromMessageLevel(): void

- - Defined in engine.ts:1056

  #### Returns void

### saveSnapshotToJSON

- saveSnapshotToJSON(): CellSaveState

- - Defined in engine.ts:1029

  #### Returns CellSaveState

### setLevel

- setLevel(levelNum: number): void

- - Defined in engine.ts:878

  #### Parameters

  - ##### levelNum: number

  #### Returns void

### setMessageLevel

- setMessageLevel(sprites: Array<Array<Set<GameSprite>>>): void

- - Defined in engine.ts:1052

  #### Parameters

  - ##### sprites: Array<Array<Set<GameSprite>>>

  #### Returns void

### tick

- tick(): ITickResult

- - Defined in engine.ts:889

  #### Returns ITickResult

Generated using TypeDoc