The state of sprites in one position of the current level being played.

This stores all the sprites and which direction those sprites want to move.

The TerminalUI uses this object to render and the GameEngine uses this to maintain the state of one position of the current level.

### Hierarchy

- Cell

## Index

### Constructors

- constructor

### Properties

- colIndex
- rowIndex
- spriteBitSet

### Methods

- _deleteWantsToMove
- _setWantsToMove
- addSprite
- clearWantsToMove
- fromSnapshot
- getCollisionLayerWantsToMove
- getCollisionLayers
- getNeighbor
- getSpriteAndWantsToMoves
- getSpriteByCollisionLayer
- getSprites
- getSpritesAsSet
- getWantsToMove
- hasCollisionWithSprite
- hasSprite
- removeSprite
- replaceSpriteInLevel
- setWantsToMoveCollisionLayer
- toKey
- toSnapshot
- toString
- updateSprite

## Constructors

### constructor

- new Cell(level: Optional<Level>, sprites: Set<GameSprite>, rowIndex: number, colIndex: number): Cell

- - Defined in engine.ts:43

  #### Parameters

  - ##### level: Optional<Level>

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

  - ##### rowIndex: number

  - ##### colIndex: number

  #### Returns Cell

## Properties

### colIndex

colIndex: number

- Defined in engine.ts:38

### rowIndex

rowIndex: number

- Defined in engine.ts:37

### spriteBitSet

spriteBitSet: SpriteBitSet

- Defined in engine.ts:39

## Methods

### _deleteWantsToMove

- _deleteWantsToMove(sprite: GameSprite): boolean

- - Defined in engine.ts:79

  #### Parameters

  - ##### sprite: GameSprite

  #### Returns boolean

### _setWantsToMove

- _setWantsToMove(sprite: GameSprite, wantsToMove: Optional<RULE_DIRECTION>): boolean

- - Defined in engine.ts:58

  #### Parameters

  - ##### sprite: GameSprite

  - ##### wantsToMove: Optional<RULE_DIRECTION>

  #### Returns boolean

### addSprite

- addSprite(sprite: GameSprite, wantsToMove: Optional<RULE_DIRECTION>): boolean

- - Defined in engine.ts:177

  #### Parameters

  - ##### sprite: GameSprite

  - ##### wantsToMove: Optional<RULE_DIRECTION>

  #### Returns boolean

### clearWantsToMove

- clearWantsToMove(sprite: GameSprite): void

- - Defined in engine.ts:173

  #### Parameters

  - ##### sprite: GameSprite

  #### Returns void

### fromSnapshot

- fromSnapshot(newSprites: Set<GameSprite>): void

- - Defined in engine.ts:228

  #### Parameters

  - ##### newSprites: Set<GameSprite>

  #### Returns void

### getCollisionLayerWantsToMove

- getCollisionLayerWantsToMove(collisionLayer: CollisionLayer): null | UP | DOWN | LEFT | RIGHT | ACTION | STATIONARY | RANDOMDIR

- - Defined in engine.ts:145

  #### Parameters

  - ##### collisionLayer: CollisionLayer

  #### Returns null | UP | DOWN | LEFT | RIGHT | ACTION | STATIONARY | RANDOMDIR

### getCollisionLayers

- getCollisionLayers(): CollisionLayer[]

- - Defined in engine.ts:110

  #### Returns CollisionLayer[]

### getNeighbor

- getNeighbor(direction: string): null | Cell

- - Defined in engine.ts:153

  #### Parameters

  - ##### direction: string

  #### Returns null | Cell

### getSpriteAndWantsToMoves

- getSpriteAndWantsToMoves(): Map<any, any>

- - Defined in engine.ts:135

  #### Returns Map<any, any>

### getSpriteByCollisionLayer

- getSpriteByCollisionLayer(collisionLayer: CollisionLayer): null | GameSprite

- - Defined in engine.ts:106

  #### Parameters

  - ##### collisionLayer: CollisionLayer

  #### Returns null | GameSprite

### getSprites

- getSprites(): GameSprite[]

- - Defined in engine.ts:115

  #### Returns GameSprite[]

### getSpritesAsSet

- getSpritesAsSet(): Set<GameSprite>

- - Defined in engine.ts:127

  #### Returns Set<GameSprite>

### getWantsToMove

- getWantsToMove(sprite: GameSprite): null | UP | DOWN | LEFT | RIGHT | ACTION | STATIONARY | RANDOMDIR

- - Defined in engine.ts:167

  #### Parameters

  - ##### sprite: GameSprite

  #### Returns null | UP | DOWN | LEFT | RIGHT | ACTION | STATIONARY | RANDOMDIR

### hasCollisionWithSprite

- hasCollisionWithSprite(otherSprite: GameSprite): boolean

- - Defined in engine.ts:170

  #### Parameters

  - ##### otherSprite: GameSprite

  #### Returns boolean

### hasSprite

- hasSprite(sprite: GameSprite): boolean

- - Defined in engine.ts:149

  #### Parameters

  - ##### sprite: GameSprite

  #### Returns boolean

### removeSprite

- removeSprite(sprite: GameSprite): boolean

- - Defined in engine.ts:210

  #### Parameters

  - ##### sprite: GameSprite

  #### Returns boolean

### Protected replaceSpriteInLevel

- replaceSpriteInLevel(cellSprite: Optional<GameSprite>, newSprite: GameSprite): void

- - Defined in engine.ts:238

  #### Parameters

  - ##### cellSprite: Optional<GameSprite>

  - ##### newSprite: GameSprite

  #### Returns void

### setWantsToMoveCollisionLayer

- setWantsToMoveCollisionLayer(collisionLayer: CollisionLayer, wantsToMove: RULE_DIRECTION): boolean

- - Defined in engine.ts:93

  #### Parameters

  - ##### collisionLayer: CollisionLayer

  - ##### wantsToMove: RULE_DIRECTION

  #### Returns boolean

### toKey

- toKey(): string

- - Defined in engine.ts:218

  #### Returns string

### toSnapshot

- toSnapshot(): Set<GameSprite>

- - Defined in engine.ts:225

  #### Returns Set<GameSprite>

### toString

- toString(): string

- - Defined in engine.ts:215

  #### Returns string

### updateSprite

- updateSprite(sprite: GameSprite, wantsToMove: RULE_DIRECTION): boolean

- - Defined in engine.ts:194

  #### Parameters

  - ##### sprite: GameSprite

  - ##### wantsToMove: RULE_DIRECTION

  #### Returns boolean

Generated using TypeDoc