Class Room
java.lang.Object
Room
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIs used to access the description of a roomIf an exit in that direction exists, this method returns that exitThis method returns a string containing all the exits of the room under the format: "exit1 exit2 exit3"Gives the description and the possible exits of a roomvoid
Allows to add an exit to a room in any given direction
-
Constructor Details
-
Room
Constructor for the class Room- Parameters:
The
- description of the created Room
-
-
Method Details
-
getExits
If an exit in that direction exists, this method returns that exit- Parameters:
pDirection
- Is a String representing the direction that the user wants to go to
-
getExitString
This method returns a string containing all the exits of the room under the format: "exit1 exit2 exit3"- Returns:
- The string containing all the exits of the current room
-
getDescription
Is used to access the description of a room- Returns:
- The description of the current room
-
setExit
Allows to add an exit to a room in any given direction- Parameters:
pDirection
- A string containing a directionpNeighbor
- A room that you want to put as a neighbor of another given room
-
getLongDescription
Gives the description and the possible exits of a room- Returns:
- The String with all of the description of the current Room and its possible exits
-