Region

class Region(val identifier: Identifier, var description: Description) : ExaminableObject

Provides a region which is a container of Room. The region has an identifier and a description.

Constructors

Link copied to clipboard
constructor(identifier: String, description: String)

Provides a region which is a container of Room. The region has an identifier and a description.

constructor(identifier: Identifier, description: Description)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val attributes: AttributeManager

An AttributeManager that provides management of all Attribute for this Examinable.

Link copied to clipboard
open override var commands: List<CustomCommand>

A list of CustomCommand that this Examinable provides.

Link copied to clipboard

Get the current room.

Link copied to clipboard
open override var description: Description

A Description that describes this object.

Link copied to clipboard

Provides a callback for handling examination of this object.

Link copied to clipboard
open override var identifier: Identifier

An Identifier that can be used to identify this object.

Link copied to clipboard
open override var isPlayerVisible: Boolean

Returns true if visible to the player, else false.

Link copied to clipboard
val rooms: Int

Get the number of rooms in this Region.

Link copied to clipboard

Specifies if this Region is visible without first being discovered.

Functions

Link copied to clipboard
fun addRoom(room: Room, x: Int, y: Int, z: Int): Boolean

Add a room at a specified x, y and z location. Returns true if the Room could be added, else false.

Link copied to clipboard
open override fun examine(scene: ExaminationScene): ExaminationResult

Examine this object to obtain an ExaminationResult. The scene that the examination occurs in must be specified.

Link copied to clipboard
fun findRoom(name: String): Room?

Try and get a Room from a specified name. If a Room with a matching name cannot be found then null will be returned.

Link copied to clipboard
operator fun get(x: Int, y: Int, z: Int): Room?

Get a Room at the specified x, y and z location.

Link copied to clipboard
fun getAdjoiningRoom(direction: Direction): Room?

Get the adjoining room in a specified direction, from the currentRoom.

fun getAdjoiningRoom(direction: Direction, room: Room?): Room?

Get the adjoining room in a specified direction from a specified room.

Link copied to clipboard

Get the RoomPosition of a room. If the specified room does not exist in this Region null is returned.

Link copied to clipboard
fun jumpToRoom(room: Room): Boolean

Jump to specified room. If the jump was possible true is returned, else false.

fun jumpToRoom(roomName: String): Boolean

Jump to a Room specified by roomName. If the jump was possible true is returned, else false.

Link copied to clipboard
fun move(direction: Direction): Boolean

Move in a specified direction. Returns true if the move was possible, else false.

Link copied to clipboard
fun setStartRoom(room: Room)

Set a specified room as the start room.

fun setStartRoom(roomName: String)

Set a Room specified by roomName as the start room.

Link copied to clipboard

Convert this to a Matrix.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Unlock an Exit in the specified direction. Also unlocks the opposing Exit on the adjoining room. If this is possible return true, else false.