public class DefaultClock extends Clock implements Runnable
The DefaultClock
is JBotSim default implementation of the Clock
.
Implementation remarks:
Constructor and Description |
---|
DefaultClock(ClockManager manager) |
Modifier and Type | Method and Description |
---|---|
int |
getTimeUnit()
Returns the time unit of the clock, in milliseconds.
|
boolean |
isRunning()
Indicates whether the clock is currently running or paused.
|
void |
pause()
Pauses the clock.
|
void |
resume()
Resumes the clock if it was paused.
|
void |
run() |
void |
setTimeUnit(int delay)
Sets the time unit of the clock to the specified value in millisecond.
|
void |
start()
Starts the clock.
|
public DefaultClock(ClockManager manager)
public int getTimeUnit()
Clock
Returns the time unit of the clock, in milliseconds. The time unit is the duration of a round.
getTimeUnit
in class Clock
public void setTimeUnit(int delay)
Clock
setTimeUnit
in class Clock
delay
- The desired time unitpublic boolean isRunning()
Clock
public void start()
Clock
public void pause()
Clock
public void resume()
Clock