Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WorldLayer

Hierarchy

  • WorldLayer

Index

Constructors

constructor

  • new WorldLayer(width: number, height: number, level: number): WorldLayer
  • Parameters

    • width: number
    • height: number
    • level: number

    Returns WorldLayer

Properties

exploredMap

exploredMap: ExploreMap

height

height: number

level

level: number

lightBlockMap

lightBlockMap: ByteGrid

lightLevelMap

lightLevelMap: ByteGrid

onDoodadUpdate

onDoodadUpdate: onDoodadUpdateDelegate

onTileUpdate

onTileUpdate: onTileUpdateDelegate

Private terrainMap

terrainMap: Uint16Array

width

width: number

Methods

getTile

  • Parameters

    • x: number
    • y: number

    Returns TerrainData

getTileType

  • Parameters

    • x: number
    • y: number

    Returns TerrainType

isFence

  • Parameters

    Returns boolean

isWall

  • Parameters

    Returns boolean

Private mapIndex

  • mapIndex(x: number, y: number): number
  • Parameters

    • x: number
    • y: number

    Returns number

resetExploredMap

  • resetExploredMap(): void
  • Returns void

setTile

  • setTile(x: number, y: number, terrainType: TerrainType | undefined, isWall?: boolean, isFence?: boolean): void
  • Parameters

    • x: number
    • y: number
    • terrainType: TerrainType | undefined
    • Default value isWall: boolean = false
    • Default value isFence: boolean = false

    Returns void

Private setTileInteral

  • setTileInteral(x: number, y: number, tile: ITile): void
  • Parameters

    • x: number
    • y: number
    • tile: ITile

    Returns void

updateAll

  • updateAll(game: Game): void
  • Parameters

    Returns void

Private updateLightBlockValue

  • updateLightBlockValue(x: number, y: number, oldValue: number): void
  • Parameters

    • x: number
    • y: number
    • oldValue: number

    Returns void

updateTile

  • updateTile(x: number, y: number, tile: ITile, shouldUpdate?: boolean): void
  • Parameters

    • x: number
    • y: number
    • tile: ITile
    • Default value shouldUpdate: boolean = false

    Returns void

Generated using TypeDoc