All Implemented Interfaces:
Tile

public class Coin extends Item
Coin class is a collectible item in the game that the hero must collect to be able to finish the level. The term coin and treasure are used interchangeably throughout the code.
  • Constructor Details

    • Coin

      public Coin(TileInfo info)
      Create a coin.
      Parameters:
      info - tile information
  • Method Details

    • type

      public TileType type()
      Description copied from interface: Tile
      Each tile object will hold a reference to one TileState enum, which determines the behaviour of a number of the tiles important methods.
      Returns:
      the enum type of this tile, if custom tile then TileType.Other is returned.
    • setOn

      public void setOn(Tile t, Domain d)
      Description copied from interface: Tile

      Sets the given tile t instead of this tile on maze, changing the domain to do so. NOTE1: may alter domain. NOTE2: does not check wether it's possible for tile t to move on this tile(thoroughly)! Although often it has a set of exceptions that will be thrown if a completely unexpected input is given.

      if not implemented defaults to replacing this tile with given tile on maze.

      Specified by:
      setOn in interface Tile
      Overrides:
      setOn in class Item
      Parameters:
      t - tile to replace this tile with, can not be null.
      d - domain where this change is happening, can not be null.