Class Treasure

java.lang.Object
nz.ac.vuw.ecs.swen225.gp22.domain.Tile
nz.ac.vuw.ecs.swen225.gp22.domain.Treasure

public class Treasure extends Tile
Represents a tile with a treasure on it, which the player can pick up by walking onto the tile.
Author:
Abdul
  • Constructor Details

    • Treasure

      public Treasure(Maze.Point tilePos)
      Default constructor, sets the position the tile, and obstructiveness to false. An observer is also added to the player so that when they are on this tile, it is reset and the treasure counter is updated.
      Parameters:
      tilePos - Point to set the position 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