Internal class that ise used to maintain the state of a level.

This should not be called directly. Instead, use GameEngine .

### Hierarchy

- EventEmitter2
  - LevelEngine

## Index

### Constructors

- constructor

### Properties

- gameData
- hasAgainThatNeedsToRun
- pendingPlayerWantsToMove

### Methods

- addListener
- canUndo
- emit
- emitAsync
- eventNames
- getCurrentLevel
- hasAgain
- listeners
- listenersAny
- many
- off
- offAny
- on
- onAny
- once
- prependAny
- prependListener
- prependMany
- prependOnceListener
- press
- pressRestart
- pressUndo
- removeAllListeners
- removeListener
- restoreFromMessageLevel
- setLevel
- setMaxListeners
- setMessageLevel
- tick
- toSnapshot

## Constructors

### constructor

- new LevelEngine(gameData: GameData): LevelEngine

- Overrides EventEmitter2.__constructor

  - Defined in engine.ts:372

  #### Parameters

  - ##### gameData: GameData

  #### Returns LevelEngine

## Properties

### gameData

gameData: GameData

- Defined in engine.ts:367

### hasAgainThatNeedsToRun

hasAgainThatNeedsToRun: boolean

- Defined in engine.ts:369

### pendingPlayerWantsToMove

pendingPlayerWantsToMove: Optional<RULE_DIRECTION>

- Defined in engine.ts:368

## Methods

### addListener

- addListener(event: string, listener: Listener): this

- Inherited from EventEmitter2.addListener

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:40

  #### Parameters

  - ##### event: string

  - ##### listener: Listener

  #### Returns this

### canUndo

- canUndo(): boolean

- - Defined in engine.ts:502

  #### Returns boolean

### emit

- emit(event: string | string[], ...values: any[]): boolean

- Inherited from EventEmitter2.emit

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:38

  #### Parameters

  - ##### event: string | string[]

  - ##### Rest ...values: any[]

  #### Returns boolean

### emitAsync

- emitAsync(event: string | string[], ...values: any[]): Promise<any[]>

- Inherited from EventEmitter2.emitAsync

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:39

  #### Parameters

  - ##### event: string | string[]

  - ##### Rest ...values: any[]

  #### Returns Promise<any[]>

### eventNames

- eventNames(): string[]

- Inherited from EventEmitter2.eventNames

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:54

  #### Returns string[]

### getCurrentLevel

- getCurrentLevel(): Level

- - Defined in engine.ts:428

  #### Returns Level

### hasAgain

- hasAgain(): boolean

- - Defined in engine.ts:498

  #### Returns boolean

### listeners

- listeners(event: string | string[]): Listener[]

- Inherited from EventEmitter2.listeners

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:55

  #### Parameters

  - ##### event: string | string[]

  #### Returns Listener[]

### listenersAny

- listenersAny(): Listener[]

- Inherited from EventEmitter2.listenersAny

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:56

  #### Returns Listener[]

### many

- many(event: string | string[], timesToListen: number, listener: Listener): this

- Inherited from EventEmitter2.many

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:45

  #### Parameters

  - ##### event: string | string[]

  - ##### timesToListen: number

  - ##### listener: Listener

  #### Returns this

### off

- off(event: string, listener: Listener): this

- Inherited from EventEmitter2.off

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:51

  #### Parameters

  - ##### event: string

  - ##### listener: Listener

  #### Returns this

### offAny

- offAny(listener: Listener): this

- Inherited from EventEmitter2.offAny

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:49

  #### Parameters

  - ##### listener: Listener

  #### Returns this

### on

- on(event: string | string[], listener: Listener): this

- Inherited from EventEmitter2.on

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:41

  #### Parameters

  - ##### event: string | string[]

  - ##### listener: Listener

  #### Returns this

### onAny

- onAny(listener: EventAndListener): this

- Inherited from EventEmitter2.onAny

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:47

  #### Parameters

  - ##### listener: EventAndListener

  #### Returns this

### once

- once(event: string | string[], listener: Listener): this

- Inherited from EventEmitter2.once

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:43

  #### Parameters

  - ##### event: string | string[]

  - ##### listener: Listener

  #### Returns this

### prependAny

- prependAny(listener: EventAndListener): this

- Inherited from EventEmitter2.prependAny

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:48

  #### Parameters

  - ##### listener: EventAndListener

  #### Returns this

### prependListener

- prependListener(event: string | string[], listener: Listener): this

- Inherited from EventEmitter2.prependListener

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:42

  #### Parameters

  - ##### event: string | string[]

  - ##### listener: Listener

  #### Returns this

### prependMany

- prependMany(event: string | string[], timesToListen: number, listener: Listener): this

- Inherited from EventEmitter2.prependMany

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:46

  #### Parameters

  - ##### event: string | string[]

  - ##### timesToListen: number

  - ##### listener: Listener

  #### Returns this

### prependOnceListener

- prependOnceListener(event: string | string[], listener: Listener): this

- Inherited from EventEmitter2.prependOnceListener

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:44

  #### Parameters

  - ##### event: string | string[]

  - ##### listener: Listener

  #### Returns this

### press

- press(direction: RULE_DIRECTION): void

- - Defined in engine.ts:506

  #### Parameters

  - ##### direction: RULE_DIRECTION

  #### Returns void

### pressRestart

- pressRestart(): void

- - Defined in engine.ts:516

  #### Returns void

### pressUndo

- pressUndo(): void

- - Defined in engine.ts:523

  #### Returns void

### removeAllListeners

- removeAllListeners(event?: string | eventNS): this

- Inherited from EventEmitter2.removeAllListeners

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:52

  #### Parameters

  - ##### Optional event: string | eventNS

  #### Returns this

### removeListener

- removeListener(event: string | string[], listener: Listener): this

- Inherited from EventEmitter2.removeListener

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:50

  #### Parameters

  - ##### event: string | string[]

  - ##### listener: Listener

  #### Returns this

### restoreFromMessageLevel

- restoreFromMessageLevel(): void

- - Defined in engine.ts:422

  #### Returns void

### setLevel

- setLevel(levelNum: number): Cell[]

- - Defined in engine.ts:384

  #### Parameters

  - ##### levelNum: number

  #### Returns Cell[]

### setMaxListeners

- setMaxListeners(n: number): void

- Inherited from EventEmitter2.setMaxListeners

  - Defined in /Users/phil/github/mine/puzzlescript/node_modules/eventemitter2/eventemitter2.d.ts:53

  #### Parameters

  - ##### n: number

  #### Returns void

### setMessageLevel

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

- - Defined in engine.ts:417

  #### Parameters

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

  #### Returns void

### tick

- tick(): object

- - Defined in engine.ts:448

  #### Returns object

  - ##### changedCells: Set<any>

  - ##### hasRestart: boolean

  - ##### isWinning: boolean

  - ##### messageToShow: null | string

  - ##### soundToPlay: null | GameSound

### toSnapshot

- toSnapshot(): string[][][]

- - Defined in engine.ts:436

  #### Returns string[][][]

Generated using TypeDoc