Package com.takenoko.layers.tile
Class Tile
java.lang.Object
com.takenoko.layers.tile.Tile
- Direct Known Subclasses:
Pond
Class Tile represents a tile in the game. A tile has a type
TileType
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TileColor
private ImprovementType
private final TileType
-
Constructor Summary
ConstructorsConstructorDescriptionTile()
Constructor of the class Tile.Tile
(ImprovementType improvementType) Tile
(ImprovementType improvementType, TileColor tileColor) Copy ConstructorConstructor of the class Tile.Tile
(TileType type, ImprovementType improvement, TileColor color) Constructor of the class Tile. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
boolean
getColor()
Get the improvement of the tile.getType()
Get the type of the tile.int
hashCode()
void
setImprovement
(ImprovementType improvement) Set the improvement of the tile.toString()
-
Field Details
-
type
-
color
-
improvement
-
-
Constructor Details
-
Tile
public Tile()Constructor of the class Tile. It creates a tile with the default type OTHERTileType
. -
Tile
-
Tile
Constructor of the class Tile. It creates a tile with the given type.- Parameters:
type
- the type of the tile
-
Tile
Constructor of the class Tile. It creates a tile with the given type and improvement.- Parameters:
type
- the type of the tilecolor
- the color of the tile
-
Tile
Copy Constructor- Parameters:
tile
- the tile to copy
-
Tile
-
Tile
-
-
Method Details
-
getType
Get the type of the tile.- Returns:
- the type of the tile
-
getImprovement
Get the improvement of the tile.- Returns:
- the improvement of the tile
-
setImprovement
Set the improvement of the tile. If the improvement is null, throw an exception. -
getColor
-
equals
-
hashCode
public int hashCode() -
copy
-
toString
-