Class Tile
java.lang.Object
nz.ac.vuw.ecs.swen225.gp22.domain.Tile
- Direct Known Subclasses:
BouncyPad
,ColorableTile
,Exit
,Ground
,InfoField
,LockedExit
,MilkPuddle
,Treasure
,Wall
Template for tiles that has fields and methods that all tiles will need.
- Author:
- Abdul
-
Constructor Summary
ConstructorDescriptionTile
(Maze.Point tilePos, boolean obstructive) Default constructor, sets the position and obstructiveness of the tile. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when a tile is removed or replaced.getPos()
boolean
void
setObstructive
(boolean obstructive) Updates the obstructiveness of this tile.void
setPos
(Maze.Point pos) Sets the position of the tile.
-
Constructor Details
-
Tile
Default constructor, sets the position and obstructiveness of the tile.- Parameters:
tilePos
- Point to set the position field to.obstructive
- Boolean to set the obstructive field to.
-
-
Method Details
-
getPos
- Returns:
- The position of the tile.
-
isObstructive
public boolean isObstructive()- Returns:
- The obstructiveness of the tile.
-
setPos
Sets the position of the tile.- Parameters:
pos
- Point that represents the tile's new position.
-
setObstructive
public void setObstructive(boolean obstructive) Updates the obstructiveness of this tile.- Parameters:
obstructive
- The new value of the obstructive field.
-
deleteTile
public void deleteTile()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.
-