public abstract class AbstractTickSource extends Object implements TickSource
doTick().| Modifier and Type | Field and Description |
|---|---|
protected Queue<TickListener> |
listeners |
| Constructor and Description |
|---|
AbstractTickSource() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(TickListener listener)
Adds a listener to fire tick events to.
|
protected void |
doTick()
Distributes a tick event to its listeners.
|
long |
getCurrentTick()
Returns the current tick.
|
void |
removeListener(TickListener listener)
Removes a tick listener.
|
void |
reset()
Resets the tick source to its initial state.
|
protected final Queue<TickListener> listeners
public void addListener(TickListener listener)
TickSourceaddListener in interface TickSourcelistener - the listener to addpublic void removeListener(TickListener listener)
TickSourceremoveListener in interface TickSourcelistener - the listener to removeprotected void doTick()
public long getCurrentTick()
TickSourcegetCurrentTick in interface TickSourcepublic void reset()
TickSourcereset in interface TickSourceCopyright © 2015. All rights reserved.