Class TRoom

Unit

Declaration

type TRoom = class(TObject)

Description

Class representing a room on the map.

Hierarchy

Overview

Methods

Public constructor Create(aconnections: TRoomConnections; afields: tfields; adescription: string);
Public procedure connect(adir: tdirection; aroom_id: integer);
Public function get_connection(adir: tdirection): integer;

Properties

Public property description: string read _description;
Public property fields: tfields read _fields;

Description

Methods

Public constructor Create(aconnections: TRoomConnections; afields: tfields; adescription: string);

constructor for a new room on the map.

Parameters
aconnections
The connection one room has with others.
afields
The fields (especially its contents) a room has.
adescription
The description prompted when entering the room.
Returns

A new instance of TRoom.

Public procedure connect(adir: tdirection; aroom_id: integer);

Prcoedure to connect an other room to on of the direction from the room.

Parameters
adir
The direction the new room should be connected to.
aroom_id
The id of the room that should be connected.
Public function get_connection(adir: tdirection): integer;

Function returning the connection that exists in the specified direction.

Parameters
adir
The direction to get the connection from.
Returns

Integer The id of the room that lays in that direction. Returns -1 if no room is connected.

Properties

Public property description: string read _description;

Read-only String-property containing the room description.

Public property fields: tfields read _fields;

Read-only Array-property containing the fields in the room.


Generated by PasDoc 0.16.0.