Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Builder<T>

Builder represents a base class used to create a new kind of map. It is meant to be inherited from, with individual specialized builders providing additional information as they generate the map. This basic Builder class can still be used for it's snapshot functionality when playing with custom map generation.

A builder's type should generally be either a number or numeric enum.

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

  • new Builder(config: { height: number; width: number }): Builder
  • Creates a new Builder

    Parameters

    • config: { height: number; width: number }
      • height: number

        The map height

      • width: number

        The map width

    Returns Builder

Methods

clearSnapshots

  • clearSnapshots(): void

copyFrom

  • copyFrom(table: Table<T>): void
  • Sets the map values to match a given table. A shallow copy is made from the given table.

    Parameters

    Returns void

getMap

getSnapshots

  • getSnapshots(): Table<T>[]

takeSnapshot

  • takeSnapshot(): void
  • Takes a snapshot of the current map state. These can be retrieved through getSnapshots()

    Returns void

Generated using TypeDoc