Package game

Class Tile

java.lang.Object
game.Tile

public class Tile extends Object
A tile on the game board.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    An enum representing the different types of Tiles that
    may appear in a sewer system.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tile(int r, int c, int cv, Tile.TileType t)
    Constructor: an instance with row r, column c, coin-value cv, and Type t.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Return the value of coins on this Tile.
    int
    Return the column of this Tile.
    int
    Return the original amount of coins on this tile.
    int
    row()
    Return the row of this Tile.
    int
    Set the value of coins on this Node to 0 and return the amount "taken"
     
    Return the TileType of this Tile.

    Methods inherited from class java.lang.Object

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

    • Tile

      public Tile(int r, int c, int cv, Tile.TileType t)
      Constructor: an instance with row r, column c, coin-value cv, and Type t.
  • Method Details

    • coins

      public int coins()
      Return the value of coins on this Tile.
    • originalCoinValue

      public int originalCoinValue()
      Return the original amount of coins on this tile.
    • row

      public int row()
      Return the row of this Tile.
    • column

      public int column()
      Return the column of this Tile.
    • type

      public Tile.TileType type()
      Return the TileType of this Tile.
    • takeCoins

      public int takeCoins()
      Set the value of coins on this Node to 0 and return the amount "taken"
    • toString

      public String toString()
      Overrides:
      toString in class Object