Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BSPDungeonBuilder<T>

DungeonGenerator creates a number of rooms, and then works to connect them.

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

Methods

clearSnapshots

  • clearSnapshots(): void

copyFrom

  • copyFrom(table: Table<T>): void

createRooms

  • createRooms(options: { maxHeight?: undefined | number; maxWidth?: undefined | number; minHeight: number; minWidth: number; padding?: undefined | number }): void
  • Creates rooms given the current BSP Tree. Use the 'split' method first to generate areas, then call createRooms to generate rooms within those areas

    Parameters

    • options: { maxHeight?: undefined | number; maxWidth?: undefined | number; minHeight: number; minWidth: number; padding?: undefined | number }

      Options to create the rooms

      • Optional maxHeight?: undefined | number

        The maximum height of a generated room. Will never be taller than the BSP area.

      • Optional maxWidth?: undefined | number

        The maximum width of a generated room. Will never be wider than the BSP area.

      • minHeight: number

        The minimum height of a generated room.

      • minWidth: number

        The minimum width of a generated room.

      • Optional padding?: undefined | number

        Can pad the area to ensure rooms aren't against the boundaries. Default 0.

    Returns void

createSimpleHallways

  • createSimpleHallways(): void

getHallways

getLeafNodes

getMap

getRooms

  • getRooms(): Rect[]

getSnapshots

  • getSnapshots(): Table<T>[]

splitByCount

  • splitByCount(count: number): void
  • Splits the dungeon n times. A count of 1 would divide the dungeon in two, count of 2 divides it in 4, etc.

    Parameters

    • count: number

      number

    Returns void

takeSnapshot

  • takeSnapshot(): void

Generated using TypeDoc