java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.domain.TileAnatomy.TileInfo

public class TileInfo extends Object
A class with some information that all tiles need to recieve to be initiated. It includes fields that are common to most tiles. This is to avoid adding more and more parameters to each tile class, and being able to pass larger chunks of information with one parameter.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a tileInfo object only with loc, pingCount defaults to 0, the imageName to "".
    TileInfo(Loc loc, int pingCount, String imageName, String message)
    Create a tileInfo object, everything can be null if its for testing purposes and the tile associated does not need the information in this object.
    TileInfo(Loc loc, String imageName)
    Create a tileInfo object only with loc and imageName, pingCount defaults to 0.
  • Method Summary

    Modifier and Type
    Method
    Description
    gets the direction the tile is facing.
    void
    sets the direction of the facing of associated tile.
    gets image name.
    loc()
    gets location of the associated tile.
    void
    loc(Loc loc)
    sets location of the associated tile.
    gets message on the tile.
    int
    gets ping of the associated tile.
    void
    increments the ping of the associated tile.
    gets the tile that is to be replaced when this tile moves, in its spot.
    void
    tileOn(Tile tile)
    sets the tile that this tile replaces under it when moved.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TileInfo

      public TileInfo(Loc loc, int pingCount, String imageName, String message)
      Create a tileInfo object, everything can be null if its for testing purposes and the tile associated does not need the information in this object.
      Parameters:
      loc - location of tile
      pingCount - ping count recorded by the tile
      imageName - the name of the image file
      message - the message associated with the tile
    • TileInfo

      public TileInfo(Loc loc)
      Create a tileInfo object only with loc, pingCount defaults to 0, the imageName to "".
      Parameters:
      loc - location of tile
    • TileInfo

      public TileInfo(Loc loc, String imageName)
      Create a tileInfo object only with loc and imageName, pingCount defaults to 0.
      Parameters:
      loc - location of tile
      imageName - the name of the image file
  • Method Details

    • getImageName

      public String getImageName()
      gets image name.
      Returns:
      image name
    • loc

      public Loc loc()
      gets location of the associated tile.
      Returns:
      location of tile
    • ping

      public int ping()
      gets ping of the associated tile.
      Returns:
      number of pings that the tile has recorded
    • message

      public String message()
      gets message on the tile.
      Returns:
      message
    • tileOn

      public Tile tileOn()
      gets the tile that is to be replaced when this tile moves, in its spot.
      Returns:
      tile to replace with this tile when moved
    • facing

      public Direction facing()
      gets the direction the tile is facing.
      Returns:
      direction of facing
    • loc

      public void loc(Loc loc)
      sets location of the associated tile.
      Parameters:
      loc - location of this tile
    • pingStep

      public void pingStep()
      increments the ping of the associated tile.
    • tileOn

      public void tileOn(Tile tile)
      sets the tile that this tile replaces under it when moved.
      Parameters:
      tile - to replace with this tile when moved
    • facing

      public void facing(Direction d)
      sets the direction of the facing of associated tile.
      Parameters:
      d - direction to set facing of this tile