Options
All
  • Public
  • Public/Protected
  • All
Menu
param [width=ROT.DEFAULT_WIDTH]
param [height=ROT.DEFAULT_HEIGHT]
param [options]

Options

param [options.born]

List of neighbor counts for a new cell to be born in empty space

param [options.survive]

List of neighbor counts for an existing cell to survive

param [options.topology]

Topology 4 or 6 or 8

Hierarchy

Index

Constructors

constructor

  • new default(width: number, height: number, options?: Partial<Options>): default

Properties

_dirs

_dirs: number[][]

_height

_height: number

_map

_map: number[][]

_options

_options: Options

_width

_width: number

Methods

_fillMap

  • _fillMap(value: number): number[][]

_findConnected

  • _findConnected(connected: PointMap, notConnected: PointMap, stack: Point[], keepNotConnected: boolean, value: number): void
  • Parameters

    • connected: PointMap
    • notConnected: PointMap
    • stack: Point[]
    • keepNotConnected: boolean
    • value: number

    Returns void

_freeSpace

  • _freeSpace(x: number, y: number, value: number): boolean

_getClosest

  • _getClosest(point: Point, space: PointMap): Point

_getFromTo

  • _getFromTo(connected: PointMap, notConnected: PointMap): Point[]
  • Find random points to connect. Search for the closest point in the larger space. This is to minimize the length of the passage while maintaining good performance.

    Parameters

    • connected: PointMap
    • notConnected: PointMap

    Returns Point[]

_getNeighbors

  • _getNeighbors(cx: number, cy: number): number
  • Get neighbor count at [i,j] in this._map

    Parameters

    • cx: number
    • cy: number

    Returns number

_pointKey

  • _pointKey(p: Point): string

_serviceCallback

_tunnelToConnected

  • _tunnelToConnected(to: Point, from: Point, connected: PointMap, notConnected: PointMap, value: number, connectionCallback?: ConnectionCallback): void
  • Parameters

    • to: Point
    • from: Point
    • connected: PointMap
    • notConnected: PointMap
    • value: number
    • Optional connectionCallback: ConnectionCallback

    Returns void

_tunnelToConnected6

  • _tunnelToConnected6(to: Point, from: Point, connected: PointMap, notConnected: PointMap, value: number, connectionCallback?: ConnectionCallback): void
  • Parameters

    • to: Point
    • from: Point
    • connected: PointMap
    • notConnected: PointMap
    • value: number
    • Optional connectionCallback: ConnectionCallback

    Returns void

connect

  • connect(callback: CreateCallback, value: number, connectionCallback?: ConnectionCallback): void
  • Make sure every non-wall space is accessible.

    Parameters

    • callback: CreateCallback

      to call to display map when do

    • value: number

      to consider empty space - defaults to 0

    • Optional connectionCallback: ConnectionCallback

    Returns void

create

randomize

  • randomize(probability: number): default
  • Fill the map with random values

    Parameters

    • probability: number

      Probability for a cell to become alive; 0 = all empty, 1 = all full

    Returns default

set

  • set(x: number, y: number, value: number): void

setOptions

  • setOptions(options: Partial<Options>): void
  • Change options.

    see

    ROT.Map.Cellular

    Parameters

    • options: Partial<Options>

    Returns void

Generated using TypeDoc