
// Room.java
// Andrew Davison, Nov 2018, ad@fivedots.coe.psu.ac.th


/* Room represents a room in the game.  It is 
 * connected to other rooms via exits.  The exits are labelled north, 
 * east, south, west.  For each direction, the room stores a reference
 * to the neighboring room, or null if there is no exit in that direction.
 * 
 * @author  Michael Kolling and David J. Barnes
 * @version 2006.03.30
 */


public class Room 
{
  public String description;
  public Room northExit, southExit, eastExit, westExit;


  public Room(String desc) 
  /* Create a room. Initially, it has no exits. 
     "description" is something like "a kitchen". */
  {  description = desc; }


  public void setExits(Room north, Room east, Room south, Room west) 
  /* Specify the 4 exits of the room. Every direction either leads
     to another room or is null (i.e. no exit in that direction) */
  {
    if (north != null)
      northExit = north;
    if (east != null)
      eastExit = east;
    if (south != null)
      southExit = south;
    if (west != null)
      westExit = west;
  }  // end of setExits()


  public String getInfo()
  {  return description; }

}  // end of Room class
