public static class Roads.Zebra extends Roads
AbstractTile
class, represents a
zebra crossing which could be present on the street. Can keep all the
known directions, except for the ones reserved to Roads.Bow
tilesRoads.Bow, Roads.Cross, Roads.Priority, Roads.Road, Roads.Stop, Roads.TrafficLight, Roads.Zebra
Constructor and Description |
---|
Roads.Zebra(java.awt.Image sprite,
Coordinates position,
Direction[] way)
Constructor of
Roads.Zebra class, calls the constructor af the
super-class Roads and assigns the type of the tile to
ZEBRA_CROSSING of the TileType enum. |
Modifier and Type | Method and Description |
---|---|
void |
changeState()
Changes the state of the variable
crossed to its opposite. |
java.lang.Boolean |
isOccupied()
Returns the state of the variable crossed.
|
java.lang.String |
toString()
Returns the string indicating the current state of the zebra crossing.
|
getPosition, getPossibleWays, getSprite, getType, setPosition, setPosition, setSprite
public Roads.Zebra(java.awt.Image sprite, Coordinates position, Direction[] way)
Roads.Zebra
class, calls the constructor af the
super-class Roads
and assigns the type of the tile to
ZEBRA_CROSSING
of the TileType
enum.sprite
- the image used to portray the tileposition
- position expressed in Coordinates
way
- the actual direction kept by the tilepublic java.lang.Boolean isOccupied()
public void changeState()
crossed
to its opposite.public java.lang.String toString()
toString
in class AbstractTile