public class ClockTickTimer
extends ch.sahits.game.openpatrician.util.Timer
| Modifier and Type | Field and Description |
|---|---|
private ch.sahits.game.openpatrician.model.Date |
clock |
private boolean |
dayChanged |
private static Object |
lock
Lock for guaranteeing thread safety
|
private org.apache.logging.log4j.Logger |
logger |
private IEventPropagator |
messagePropagator |
private com.google.common.eventbus.AsyncEventBus |
timerEventBus |
| Constructor and Description |
|---|
ClockTickTimer(long interval,
long duration) |
| Modifier and Type | Method and Description |
|---|---|
void |
handlePause(PauseGame event) |
void |
handleResume(ResumeGame event) |
protected void |
onFinish() |
protected void |
onTick() |
private void |
register() |
void |
tick()
Update the time by one tick.
|
private void |
unregister() |
private final org.apache.logging.log4j.Logger logger
@Autowired private ch.sahits.game.openpatrician.model.Date clock
@Autowired @Qualifier(value="timerEventBus") private com.google.common.eventbus.AsyncEventBus timerEventBus
@Autowired private IEventPropagator messagePropagator
private boolean dayChanged
private static Object lock
@PostConstruct private void register()
@PreDestroy private void unregister()
protected void onTick()
onTick in class ch.sahits.game.openpatrician.util.Timerprotected void onFinish()
onFinish in class ch.sahits.game.openpatrician.util.Timerpublic void tick()
public void handlePause(PauseGame event)
public void handleResume(ResumeGame event)
Copyright © 2011-2017 Sahits GmbH. All Rights Reserved.