Room.java (793B)
1 package Monster; 2 3 public class Room { 4 private String name; 5 private Room north, south, east, west; 6 7 public Room(String name) { this.name = name; } 8 9 public Room(String name, Room north, Room south, Room east, Room west) { 10 this.name = name; 11 this.north = north; 12 this.south = south; 13 this.east = east; 14 this.west = west; 15 } 16 17 public void setNorth(Room north) { this.north = north; } 18 public void setSouth(Room south) { this.south = south; } 19 public void setEast(Room east) { this.east = east; } 20 public void setWest(Room west) { this.west = west; } 21 22 public Room getNorth() { return this.north; } 23 public Room getSouth() { return this.south; } 24 public Room getEast() { return this.east; } 25 public Room getWest() { return this.west; } 26 27 public String getName() { return this.name; } 28 };