public static class Roads.Bow extends Roads
AbstractTile
class, represents a
bow which only keeps East-North, East-South, West-North, West-South
directions.
Notes: as a first implementation has been decided to directly use the name of the sprites present in the project folder, so considering the fact the images have been saved by a progressive number, the control on the center of the bow uses integer variables.
Roads.Bow, Roads.Cross, Roads.Priority, Roads.Road, Roads.Stop, Roads.TrafficLight, Roads.Zebra
Constructor and Description |
---|
Roads.Bow(java.awt.Image sprite,
Coordinates position,
Direction[] way,
int source)
Constructor of the
Roads.Bow class, calls the constructor of the
super-class Roads , assigns the type of the tile to
BOW of the TileType enum, the grade of the bow and
the center of the bow expressed in Coordinates . |
Modifier and Type | Method and Description |
---|---|
Coordinates |
getCenterBow()
Returns the center of the bow.
|
void |
setCenterBow(int source)
Sets the center of the bow depending on the direction kept by the bow
Notes: If the direction is South-West or East-North the center
of the bow is the same as the normal coordinates of the tile.
|
getPosition, getPossibleWays, getSprite, getType, setPosition, setPosition, setSprite, toString
public Roads.Bow(java.awt.Image sprite, Coordinates position, Direction[] way, int source)
Roads.Bow
class, calls the constructor of the
super-class Roads
, assigns the type of the tile to
BOW
of the TileType
enum, the grade of the bow and
the center of the bow expressed in Coordinates
.sprite
- the image used to portray the tileposition
- position expressed in Coordinates
way
- the actual direction kept by the tilesource
- the name of the sprite usedpublic Coordinates getCenterBow()
Coordinates
public void setCenterBow(int source)
Notes:
source
- the name of the sprite used