Class Tile

java.lang.Object
nz.ac.vuw.ecs.swen225.gp22.domain.Tile
Direct Known Subclasses:
BouncyPad, ColorableTile, Exit, Ground, InfoField, LockedExit, MilkPuddle, Treasure, Wall

public abstract class Tile extends Object
Template for tiles that has fields and methods that all tiles will need.
Author:
Abdul
  • Constructor Details

    • Tile

      public Tile(Maze.Point tilePos, boolean obstructive)
      Default constructor, sets the position and obstructiveness of the tile.
      Parameters:
      tilePos - Point to set the position field to.
      obstructive - Boolean to set the obstructive field to.
  • Method Details

    • getPos

      public Maze.Point getPos()
      Returns:
      The position of the tile.
    • isObstructive

      public boolean isObstructive()
      Returns:
      The obstructiveness of the tile.
    • setPos

      public void setPos(Maze.Point pos)
      Sets the position of the tile.
      Parameters:
      pos - Point that represents the tile's new position.
    • setObstructive

      public void setObstructive(boolean obstructive)
      Updates the obstructiveness of this tile.
      Parameters:
      obstructive - The new value of the obstructive field.
    • deleteTile

      public void deleteTile()
      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.