Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SimpleHallway<ForkName, StairName>

This class represents a "hallway" that is simple enough that it is redundant to give further directions from it to any room inside of it. This can be useful when describing a room that's inside of another room.

Example:

Type parameters

  • ForkName: string

  • StairName: string

Hierarchy

  • Hallway<ForkName, StairName>
    • SimpleHallway

Index

Constructors

constructor

Properties

Readonly allowFrontConnectionsInMiddle

allowFrontConnectionsInMiddle: boolean

hallwayName

hallwayName: string

Readonly oneWay

oneWay: OneWay

partList

partList: (Turn | Room<ForkName> | Stairs<StairName>)[]

An array of every Room, Stairs, or Turn in the hallway. You can choose arbitrarily which end of the hallway to start at, but make sure to keep the sides and directions of the Rooms, Stairs, and Turns consistent with the direction you choose as forward.

Accessors

nodes

  • get nodes(): { edgeLengthFromPreviousNodeInHallway: number; nodeId: Node<ForkName, StairName> }[]
  • An array of all of the node IDs in this hallway.

    Returns { edgeLengthFromPreviousNodeInHallway: number; nodeId: Node<ForkName, StairName> }[]

Methods

getDirectionsFromIndices

  • getDirectionsFromIndices(from: number, to: number): string

getRoomInd

  • getRoomInd(name: string): number
  • Parameters

    • name: string

    Returns number

    The index of the room, or -1 if there's no room with that name

idOfClosestNodeToIndex

  • idOfClosestNodeToIndex(roomInd: number, allowedConnections: (ForkName | StairName)[]): Node<ForkName, StairName>
  • Parameters

    • roomInd: number

      The index of the room in this hallway

    • allowedConnections: (ForkName | StairName)[]

    Returns Node<ForkName, StairName>

    The id of the "closest" node to the given room within this hallway

Generated using TypeDoc