Package ui

Class Tile


public class Tile extends Object
Represents one square unit of the maze grid.
  • Nested Class Summary Link icon

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    The type of wall tile, specified by its shape (0=non-wall, 2=wall cap, 3=wall flat, 4=wall joint) and rotation.
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    static final Color
    The color of the maze walls
    private final double
    The elevation of this tile.
    private final int
    The horizontal position of this tile.
    private final int
    The vertical position of this tile.
    private final Tile.TileType
    The type of this tile.
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Tile(Tile.TileType type, int i, int j, double elevation)
    Construct a new Tile at the given location `(i,j)` with the given `type` and `elevation`.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    Draw this tile using the Graphics object `g` at the scaling specified by `tileDim`.

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details Link icon

    • CARNELLIAN Link icon

      public static final Color CARNELLIAN
      The color of the maze walls
    • type Link icon

      private final Tile.TileType type
      The type of this tile.
    • i Link icon

      private final int i
      The horizontal position of this tile.
    • j Link icon

      private final int j
      The vertical position of this tile.
    • elevation Link icon

      private final double elevation
      The elevation of this tile.
  • Constructor Details Link icon

    • Tile Link icon

      public Tile(Tile.TileType type, int i, int j, double elevation)
      Construct a new Tile at the given location `(i,j)` with the given `type` and `elevation`.
  • Method Details Link icon

    • paint Link icon

      public void paint(Graphics2D g2)
      Draw this tile using the Graphics object `g` at the scaling specified by `tileDim`.