public abstract class AbstractTile extends java.lang.Object implements ITile
The only abstract methods are getWay()
and getPossibleWays()
.
Constructor and Description |
---|
AbstractTile(java.awt.Image sprite,
Coordinates position)
Constructor of
AbstractTile class, assigns the passed parameters
to the respective variables. |
Modifier and Type | Method and Description |
---|---|
Coordinates |
getPosition()
Returns the position, on the map, of the tile under consideration.
|
Direction[] |
getPossibleWays()
Returns the possible directions the car can take on the specified tile.
|
java.awt.Image |
getSprite()
Returns the sprite used to portray the tile.
|
TileType |
getType()
Returns the run-time type of the tile under consideration.
|
void |
setPosition(Coordinates coords)
Sets the position, on the map, of the tile under consideration.
|
void |
setPosition(java.lang.Integer x,
java.lang.Integer y)
Sets the position, on the map, of the tile under consideration.
|
void |
setSprite(java.awt.Image sprite)
Sets the sprite used to portray the tile.
|
java.lang.String |
toString() |
public AbstractTile(java.awt.Image sprite, Coordinates position)
AbstractTile
class, assigns the passed parameters
to the respective variables.sprite
- the image used to portray the tileposition
- position expressed in Coordinates
public Direction[] getPossibleWays()
ITile
getPossibleWays
in interface ITile
public TileType getType()
ITile
public java.awt.Image getSprite()
ITile
public void setSprite(java.awt.Image sprite)
ITile
public Coordinates getPosition()
ITile
getPosition
in interface ITile
Coordinates
public void setPosition(Coordinates coords)
ITile
setPosition
in interface ITile
coords
- position expresses in Coordinates
public void setPosition(java.lang.Integer x, java.lang.Integer y)
ITile
setPosition
in interface ITile
x
- the row on the mapy
- the column on the mappublic java.lang.String toString()
toString
in class java.lang.Object