Package ui

Class Tile


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

    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

    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

    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

    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

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

    • CARNELLIAN

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

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

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

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

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

    • Tile

      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

    • paint

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