Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class Room here.
- *
- * @author Daffa Tristan Firdaus
- * @version 18 November 2020
- */
- public class Room
- {
- public String description;
- public Room northExit;
- public Room southExit;
- public Room eastExit;
- public Room westExit;
- /**
- * Create a room described "description". Initially, it has
- * no exits. "description" is something like "a kitchen" or
- *"an open court yard".
- *
- * @param String description
- */
- public Room(String description)
- {
- this.description = description;
- }
- public void setExits(Room north, Room east, Room south, Room west)
- {
- if(north != null)
- northExit = north;
- if(east != null)
- eastExit = east;
- if(south != null)
- southExit = south;
- if(west != null)
- westExit = west;
- }
- public String getDescription()
- {
- return description;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment