Class LockedDoor


public class LockedDoor extends ColorableTile
Represents a tile which the player can only walk on if they have a key of the correct color.
Author:
Abdul
  • Constructor Details

    • LockedDoor

      public LockedDoor(Maze.Point tilePos, ColorableTile.Color color)
      Default constructor, sets the position and color of the tile, and obstructiveness to true. An observer is also added to the player so that the obstructiveness is updated based on the player's keys. The same observer makes sure that when they are on this tile, it is reset and the key is consumed from the player's inventory.
      Parameters:
      tilePos - Point to set the position field to.
      color - Color to set the color field to.
  • Method Details

    • deleteTile

      public void deleteTile()
      Description copied from class: Tile
      Called when a tile is removed or replaced. This method is not abstract because not all tiles will need special code to run on deletion.
      Overrides:
      deleteTile in class Tile
    • toString

      public String toString()
      Overrides:
      toString in class Object