Advertisement
kuchuz

PBO-C 6 : Room()

Jan 11th, 2021
1,002
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. public class Room
  2. {
  3.     public String description;
  4.     public Room northExit;
  5.     public Room southExit;
  6.     public Room eastExit;
  7.     public Room westExit;
  8.      
  9.     public Room(String description)
  10.     {
  11.         this.description = description;
  12.     }
  13.  
  14.     public void setExits(Room north, Room east, Room south, Room west)
  15.     {
  16.         if(north != null)
  17.             northExit = north;
  18.         if(east != null)
  19.             eastExit = east;
  20.         if(south != null)
  21.             southExit = south;
  22.         if(west != null)
  23.             westExit = west;
  24.     }
  25.      
  26.     public String getDescription()
  27.     {
  28.         return description;
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement