Package com.bdtripp.hauntedhouse.model
Class Exit
java.lang.Object
com.bdtripp.hauntedhouse.model.Exit
Represents an exit connecting one room to another.
An Exit has a direction, a neighboring room, and an exit type indicating whether it is locked or
unlocked.
- Author:
- Brian Tripp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the room that the exit leads to.getType()Returns the type of exit.
-
Constructor Details
-
Exit
Creates an exit and sets its direction, neighbor, and type.- Parameters:
direction- the direction of the exit.neighbor- the neighboring roomtype- the type of exit (locked or unlocked)
-
-
Method Details
-
getNeighbor
Returns the room that the exit leads to.- Returns:
- the room.
-
getType
Returns the type of exit.- Returns:
- the type of exit.
-