public class ModelCar extends AbstrModelVehicle
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SPRITE_EXTENSION
Extension used for sprites.
|
static java.lang.String |
DEFAULT_SPRITE_PATH
Default path to retrieve default image of cars.
|
STANDARD_SPEED
NUM_FRAMES, TIME_SLICE
Constructor and Description |
---|
ModelCar(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
java.awt.Image |
getSprite()
Returns sprite image of vehicle.
|
boolean |
isRunning()
Check if thread is running or not and return true if it is running, false otherwise.
|
void |
start()
Start a new thread that update vehicle every
IThreadVehicle.TIME_SLICE fraction of second. |
degreesToDirection, directionToDegrees, getAnglesPosition, getCenterPoint, getCurvatureAngleActual, getCurvatureAngleActualInDegrees, getCurvatureAngleToReach, getName, getPixelsToGo, getPosition, getSpeed, getSpeedToReach, getThread, getWay, kmPerHoursToPixelPerTimeSlice, kmPerHourToMetersPerSec, metersPerSecToKmPerHour, setCurvatureAngleActual, setCurvatureAngleActualInDegrees, setCurvatureAngleToReach, setName, setPixelsToGo, setPosition, setPosition, setSpeed, setSpeedToReach, setSprite, setThread, toString
public static final java.lang.String DEFAULT_SPRITE_PATH
public static final java.lang.String DEFAULT_SPRITE_EXTENSION
public void start() throws java.lang.IllegalStateException
IThreadVehicle.TIME_SLICE
fraction of second.start
in interface IModelVehicle
start
in class AbstrModelVehicle
java.lang.IllegalStateException
- Thread cannot be instantiate if vehicle is positioned out of mappublic boolean isRunning()
isRunning
in interface IModelVehicle
isRunning
in class AbstrModelVehicle
public java.awt.Image getSprite()
IModelVehicle
getSprite
in interface IModelVehicle
getSprite
in class AbstrModelVehicle