Package ui
Class Tile
java.lang.Object
ui.Tile
Represents one square unit of the maze grid.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic 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
FieldsModifier and TypeFieldDescriptionstatic final Color
The color of the maze wallsprivate 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
ConstructorsConstructorDescriptionTile
(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 TypeMethodDescriptionvoid
paint
(Graphics2D g2) Draw this tile using the Graphics object `g` at the scaling specified by `tileDim`.
-
Field Details
-
CARNELLIAN
The color of the maze walls -
type
The type of this tile. -
i
private final int iThe horizontal position of this tile. -
j
private final int jThe vertical position of this tile. -
elevation
private final double elevationThe elevation of this tile.
-
-
Constructor Details
-
Tile
Construct a new Tile at the given location `(i,j)` with the given `type` and `elevation`.
-
-
Method Details
-
paint
Draw this tile using the Graphics object `g` at the scaling specified by `tileDim`.
-