Class TileInfo
java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.domain.TileAnatomy.TileInfo
A class with some information that all tiles need to recieve to be initiated. It includes fields
that are common to most tiles. This is to avoid adding more and more parameters to each tile
class, and being able to pass larger chunks of information with one parameter.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a tileInfo object only with loc, pingCount defaults to 0, the imageName to "".Create a tileInfo object, everything can be null if its for testing purposes and the tile associated does not need the information in this object.Create a tileInfo object only with loc and imageName, pingCount defaults to 0. -
Method Summary
Modifier and TypeMethodDescriptionfacing()gets the direction the tile is facing.voidsets the direction of the facing of associated tile.gets image name.loc()gets location of the associated tile.voidsets location of the associated tile.message()gets message on the tile.intping()gets ping of the associated tile.voidpingStep()increments the ping of the associated tile.tileOn()gets the tile that is to be replaced when this tile moves, in its spot.voidsets the tile that this tile replaces under it when moved.
-
Constructor Details
-
TileInfo
Create a tileInfo object, everything can be null if its for testing purposes and the tile associated does not need the information in this object.- Parameters:
loc- location of tilepingCount- ping count recorded by the tileimageName- the name of the image filemessage- the message associated with the tile
-
TileInfo
Create a tileInfo object only with loc, pingCount defaults to 0, the imageName to "".- Parameters:
loc- location of tile
-
TileInfo
Create a tileInfo object only with loc and imageName, pingCount defaults to 0.- Parameters:
loc- location of tileimageName- the name of the image file
-
-
Method Details
-
getImageName
gets image name.- Returns:
- image name
-
loc
gets location of the associated tile.- Returns:
- location of tile
-
ping
public int ping()gets ping of the associated tile.- Returns:
- number of pings that the tile has recorded
-
message
gets message on the tile.- Returns:
- message
-
tileOn
gets the tile that is to be replaced when this tile moves, in its spot.- Returns:
- tile to replace with this tile when moved
-
facing
gets the direction the tile is facing.- Returns:
- direction of facing
-
loc
sets location of the associated tile.- Parameters:
loc- location of this tile
-
pingStep
public void pingStep()increments the ping of the associated tile. -
tileOn
sets the tile that this tile replaces under it when moved.- Parameters:
tile- to replace with this tile when moved
-
facing
sets the direction of the facing of associated tile.- Parameters:
d- direction to set facing of this tile
-