Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Table<T>

Type parameters

  • T

Hierarchy

  • Table

Index

Constructors

constructor

  • new Table(width: number, height: number): Table

Properties

Readonly height

height: number

items

items: T[] = []

Readonly width

width: number

Methods

clear

clone

fill

  • fill(value: T): void

filter

  • filter(match: (v: Vector2, val: T | undefined) => boolean): Vector2[]

floodFillSelect

  • floodFillSelect(pos: Vector2, targetValue?: T | undefined): Vector2[]

get

  • get(__namedParameters: { x: number; y: number }): T | undefined
  • Parameters

    • __namedParameters: { x: number; y: number }
      • x: number
      • y: number

    Returns T | undefined

getNeighbors

  • getNeighbors(pos: Vector2, predicate?: undefined | ((pos: Vector2, t: T | undefined) => Boolean), topology?: "four" | "eight"): Vector2[]
  • Parameters

    • pos: Vector2
    • Optional predicate: undefined | ((pos: Vector2, t: T | undefined) => Boolean)
    • Default value topology: "four" | "eight" = "eight"

    Returns Vector2[]

isInBounds

  • isInBounds(__namedParameters: { x: number; y: number }): boolean
  • Parameters

    • __namedParameters: { x: number; y: number }
      • x: number
      • y: number

    Returns boolean

isSameSize

  • isSameSize(other: Table<T>): boolean

set

  • set(pos: Vector2, item: T | undefined): void

Generated using TypeDoc