Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace TileHelpers

Index

Variables

Const maskDoodadAnimationDisabled

maskDoodadAnimationDisabled: 524288 = 524288

Const maskDoodadAnimationDisabledShift

maskDoodadAnimationDisabledShift: number = maskDoodadOverHiddenShift + 1

Const maskDoodadOverHidden

maskDoodadOverHidden: 262144 = 262144

Const maskDoodadOverHiddenShift

maskDoodadOverHiddenShift: number = maskTilledShift + 1

Const maskGfx

maskGfx: 31 = 31

Const maskTilled

maskTilled: 131072 = 131072

Const maskTilledShift

maskTilledShift: number = maskTypeShift + 12

Const maskType

maskType: 131040 = 131040

Const maskTypeShift

maskTypeShift: 5 = 5

Functions

atlas

  • atlas(tile: ITile): { isFloor: any; isLava: any; isMountain: any; isOre: any; isWater: any }
  • Parameters

    Returns { isFloor: any; isLava: any; isMountain: any; isOre: any; isWater: any }

    • isFloor: any
    • isLava: any
    • isMountain: any
    • isOre: any
    • isWater: any

findMatchingTile

  • findMatchingTile(start: IVector3, isMatchingTile: (point: IVector3, tile: ITile) => boolean, options?: { canVisitTile?: undefined | ((point: IVector3, tile: ITile) => boolean); maxTilesChecked?: undefined | number }): IVector3 | undefined
  • Parameters

    • start: IVector3
    • isMatchingTile: (point: IVector3, tile: ITile) => boolean
    • Default value options: { canVisitTile?: undefined | ((point: IVector3, tile: ITile) => boolean); maxTilesChecked?: undefined | number } = {}
      • Optional canVisitTile?: undefined | ((point: IVector3, tile: ITile) => boolean)
      • Optional maxTilesChecked?: undefined | number

    Returns IVector3 | undefined

findMatchingTiles

  • findMatchingTiles(start: IVector3, isMatchingTile: (point: IVector3, tile: ITile) => boolean, options?: { canVisitTile?: undefined | ((point: IVector3, tile: ITile) => boolean); maxTiles?: undefined | number; maxTilesChecked?: undefined | number }): Array<{ point: IVector3; tile: ITile }>
  • Parameters

    • start: IVector3
    • isMatchingTile: (point: IVector3, tile: ITile) => boolean
    • Default value options: { canVisitTile?: undefined | ((point: IVector3, tile: ITile) => boolean); maxTiles?: undefined | number; maxTilesChecked?: undefined | number } = {}
      • Optional canVisitTile?: undefined | ((point: IVector3, tile: ITile) => boolean)
      • Optional maxTiles?: undefined | number
      • Optional maxTilesChecked?: undefined | number

    Returns Array<{ point: IVector3; tile: ITile }>

forTilesInRange

  • forTilesInRange(point: IVector3, range: number, consumer: (vec: IVector3, tileValue: number) => any): void
  • forTilesInRange(point: IVector3, range: number, includeCenter: true, consumer: (vec: IVector3, tileValue: number) => any): void
  • Parameters

    • point: IVector3
    • range: number
    • consumer: (vec: IVector3, tileValue: number) => any
        • (vec: IVector3, tileValue: number): any
        • Parameters

          Returns any

    Returns void

  • Parameters

    • point: IVector3
    • range: number
    • includeCenter: true
    • consumer: (vec: IVector3, tileValue: number) => any
        • (vec: IVector3, tileValue: number): any
        • Parameters

          Returns any

    Returns void

getGfx

  • getGfx(tile: ITile): number
  • Parameters

    Returns number

getGfxRaw

  • getGfxRaw(data: number): number
  • Parameters

    • data: number

    Returns number

getPointsAround

  • getPointsAround(point: IVector3, includeCurrentTile?: boolean, includeCorners?: boolean): IVector3[]
  • Parameters

    • point: IVector3
    • Default value includeCurrentTile: boolean = false
    • Default value includeCorners: boolean = false

    Returns IVector3[]

getSuitableSpawnPoint

  • Returns IVector3

getTileVariation

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

    • x: number
    • y: number

    Returns number

getTilesAround

  • getTilesAround(point: IVector3, includeCurrentTile?: boolean, includeCorners?: boolean): ITile[]
  • Array version of TileHelpers.tilesAround

    Parameters

    • point: IVector3
    • Default value includeCurrentTile: boolean = false
    • Default value includeCorners: boolean = false

    Returns ITile[]

getType

  • getType(tile: ITile): TerrainType
  • Parameters

    Returns TerrainType

getTypeRaw

  • getTypeRaw(data: number): TerrainType
  • Parameters

    • data: number

    Returns TerrainType

isDoodadAnimationDisabled

  • isDoodadAnimationDisabled(tile: ITile): boolean
  • Parameters

    Returns boolean

isDoodadAnimationDisabledRaw

  • isDoodadAnimationDisabledRaw(data: number): boolean
  • Parameters

    • data: number

    Returns boolean

isDoodadOverHidden

  • isDoodadOverHidden(tile: ITile): boolean
  • Parameters

    Returns boolean

isDoodadOverHiddenRaw

  • isDoodadOverHiddenRaw(data: number): boolean
  • Parameters

    • data: number

    Returns boolean

isOpenTile

  • isOpenTile(point: IVector3, tile?: any): boolean
  • Check is a tile is open

    Parameters

    • point: IVector3
    • Default value tile: any = game.getTile(point.x, point.y, point.z)

    Returns boolean

isSuitableSpawnPointTile

  • isSuitableSpawnPointTile(point: IVector3, tile: ITile): boolean
  • Check if a tile is a suitable spawn point

    Parameters

    Returns boolean

isSuitableSpawnPointTileForMultiplayer

  • isSuitableSpawnPointTileForMultiplayer(point: IVector3, tile: ITile, disallowWater?: undefined | false | true): boolean
  • Check if a tile is a suitable spawn point

    Parameters

    • point: IVector3
    • tile: ITile
    • Optional disallowWater: undefined | false | true

    Returns boolean

isTileBlocked

  • isTileBlocked(point: IVector3): boolean
  • Check if the tile is blocked (impassable terrain or doodads that cause blocked movement).

    Parameters

    Returns boolean

isTilled

  • isTilled(tile: ITile): boolean
  • Parameters

    Returns boolean

isTilledRaw

  • isTilledRaw(data: number): boolean
  • Parameters

    • data: number

    Returns boolean

isTypeInGroup

  • Parameters

    Returns boolean

openTileInRange

  • openTileInRange(point: IVector3, range: number, includeCurrentTile?: boolean): undefined | [Vector3, any]
  • Parameters

    • point: IVector3
    • range: number
    • Default value includeCurrentTile: boolean = false

    Returns undefined | [Vector3, any]

setDoodadAnimationDisabled

  • setDoodadAnimationDisabled(tile: ITile, value: boolean): void
  • Parameters

    • tile: ITile
    • value: boolean

    Returns void

setDoodadAnimationDisabledRaw

  • setDoodadAnimationDisabledRaw(data: number, value: number): number
  • Parameters

    • data: number
    • value: number

    Returns number

setDoodadOverHidden

  • setDoodadOverHidden(tile: ITile, value: boolean): void
  • Parameters

    • tile: ITile
    • value: boolean

    Returns void

setDoodadOverHiddenRaw

  • setDoodadOverHiddenRaw(data: number, value: number): number
  • Parameters

    • data: number
    • value: number

    Returns number

setGfx

  • setGfx(tile: ITile, value: number): void
  • This should only be called if you know what you're doing Use game.changeTile or game.removeTopTile when modifying tiles Otherwise the game state could get out of sync

    Parameters

    • tile: ITile
    • value: number

    Returns void

setGfxRaw

  • setGfxRaw(data: number, value: number): number
  • This should only be called from MapGen code

    Parameters

    • data: number
    • value: number

    Returns number

setTilled

  • setTilled(tile: ITile, value: boolean): void
  • This should only be called if you know what you're doing Ensure a tile data with tilled is created Otherwise the game state could get out of sync

    Parameters

    • tile: ITile
    • value: boolean

    Returns void

setTilledRaw

  • setTilledRaw(data: number, value: number): number
  • Parameters

    • data: number
    • value: number

    Returns number

setType

  • setType(tile: ITile, value: TerrainType): void
  • This should only be called if you know what you're doing Use game.changeTile or game.removeTopTile when modifying tiles Otherwise the game state could get out of sync

    Parameters

    • tile: ITile
    • value: TerrainType

    Returns void

setTypeRaw

  • setTypeRaw(data: number, value: TerrainType): number
  • This should only be called from MapGen code

    Parameters

    • data: number
    • value: TerrainType

    Returns number

tilesAround

  • tilesAround(point: IVector3, includeCurrentTile?: boolean, includeCorners?: boolean): Generator<any, void, unknown>
  • IterableIterator version of TileHelpers.getTilesAround

    Parameters

    • point: IVector3
    • Default value includeCurrentTile: boolean = false
    • Default value includeCorners: boolean = false

    Returns Generator<any, void, unknown>

tilesInRange

  • tilesInRange(point: IVector3, range: number, includeCurrentTile?: boolean): Stream<[Vector3, any]>
  • Parameters

    • point: IVector3
    • range: number
    • Default value includeCurrentTile: boolean = false

    Returns Stream<[Vector3, any]>

Generated using TypeDoc