Neighbors

Class in ChivalrousGames.DungeonMaster

Description

Neighboring Rooms of a Room.

Properties

Up Room ReadOnly
The Upward Room neighbor.
Down Room ReadOnly
The Downward Room neighbor.
Left Room ReadOnly
The Leftward Room neighbor.
Right Room ReadOnly
The Rightward Room neighbor.
Forward Room ReadOnly
The Forward Room neighbor.
Backward Room ReadOnly
The Backward Room neighbor.
Count int ReadOnly
The number of neighbors.

Constructors

Constructor
public Neighbors (Room up, Room right, Room down, Room left, Room forward, Room backward);
Parameters
up Room The Upward Room neighbor.
right Room The Rightward Room neighbor.
down Room The Downward Room neighbor.
left Room The Leftward Room neighbor.
Forward Room The Forward Room neighbor.
Backward Room The Backward Room neighbor.
Return

A new instance of Neighbors

Description

Creates a new instance of Neighbors wit specified neighboring Rooms.

Methods

GetNeighborsAsList
public List GetNeighborsAsList();
Return
List<Room> The list of neighbors.
Description

Gets the neighbors as list. Null neighbors are not included in the list.

GetNeighborByDirection
public Room GetNeighborByDirection(Direction direction);
Parameters
direction Direction The Direction of the requested neighboring Room.
Return
Room The neighboring Room if any; if none, then null is returned.
Description

Gets the neighbor in a specified Direction.