Class AbstractTile

java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.domain.TileAnatomy.AbstractTile
All Implemented Interfaces:
Tile
Direct Known Subclasses:
Actor, Door, Empty, Floor, Info, Item, Null, Periphery, Wall

public abstract class AbstractTile extends Object implements Tile
This class is the parent class of all tiles in the game. It contains the information of the tile, and the methods that are common to all tiles.
  • Field Details

  • Constructor Details

    • AbstractTile

      public AbstractTile(TileInfo info)
      constructor for a tile which takes tile information(currently all tiles take this).
      Parameters:
      info - tile info
      Throws:
      NullPointerException - if TileInfo is null
  • Method Details

    • info

      public TileInfo info()
      Description copied from interface: Tile
      Each tile will hold an info object, which stores most "field-like" info that the tile may have. Eg location of tile, number of pings that tile has seen, image name of the tile, etc. This allows us to pass only one parameter when constructing a tile.
      Specified by:
      info in interface Tile
      Returns:
      TileInfo object of the this tile
    • symbol

      public char symbol()
      Description copied from interface: Tile
      Each tile type should have a symbol, this is for testing purposes.
      Specified by:
      symbol in interface Tile
      Returns:
      symbol character for this tile type