Class Key
java.lang.Object
nz.ac.vuw.ecs.swen225.gp22.domain.Tile
nz.ac.vuw.ecs.swen225.gp22.domain.ColorableTile
nz.ac.vuw.ecs.swen225.gp22.domain.Key
Represents a tile with a key on it, which the player
can pick up by walking onto the tile.
- Author:
- Abdul
-
Nested Class Summary
Nested classes/interfaces inherited from class nz.ac.vuw.ecs.swen225.gp22.domain.ColorableTile
ColorableTile.Color
-
Constructor Summary
ConstructorDescriptionKey
(Maze.Point tilePos, ColorableTile.Color color) Default constructor, sets the position and color of the tile, and obstructiveness to false. -
Method Summary
Methods inherited from class nz.ac.vuw.ecs.swen225.gp22.domain.ColorableTile
getColor
Methods inherited from class nz.ac.vuw.ecs.swen225.gp22.domain.Tile
getPos, isObstructive, setObstructive, setPos
-
Constructor Details
-
Key
Default constructor, sets the position and color of the tile, and obstructiveness to false. An observer is also added to the player so that when they are on this tile, it is reset and a key is added to the player inventory.- Parameters:
tilePos
- Point to set the position field to.color
- Color to set the color field to.
-
-
Method Details
-
deleteTile
public void deleteTile()Description copied from class:Tile
Called when a tile is removed or replaced. This method is not abstract because not all tiles will need special code to run on deletion.- Overrides:
deleteTile
in classTile
-
toString
-