Class Exit

java.lang.Object
com.bdtripp.hauntedhouse.model.Exit

public class Exit extends Object
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 Details

    • Exit

      public Exit(Direction direction, Room neighbor, ExitType type)
      Creates an exit and sets its direction, neighbor, and type.
      Parameters:
      direction - the direction of the exit.
      neighbor - the neighboring room
      type - the type of exit (locked or unlocked)
  • Method Details

    • getNeighbor

      public Room getNeighbor()
      Returns the room that the exit leads to.
      Returns:
      the room.
    • getType

      public ExitType getType()
      Returns the type of exit.
      Returns:
      the type of exit.