public class Timer
extends java.lang.Object
| Constructor and Description |
|---|
Timer() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the timer
|
static void |
cancelAllTimers()
Cancels all running timers.
|
static long |
getTimeMillis() |
static Timer |
getTimerByName(java.lang.String name,
Peer peer)
Returns the timer with the specified name
|
static long |
getTimeSeconds() |
static boolean |
hasTimer(java.lang.String name,
Peer peer) |
static Timer |
startCounterTimer(LuaClosure closure,
float delaySeconds,
float intervalSeconds,
int repeatCount,
java.lang.String name)
Start a timer that shows up on the UI and execute the callback when expired.
|
static Timer |
startCounterTimerForPeer(LuaClosure closure,
float delaySeconds,
float intervalSeconds,
int repeatCount,
java.lang.String name,
io.lurkers.server.Peer peer) |
static Timer |
startCounterTimerForPeer(LuaClosure closure,
float delaySeconds,
float intervalSeconds,
int repeatCount,
java.lang.String name,
Peer peer)
Start a timer that shows up on the UI for the specified peer only and execute the callback when expired.
|
static Timer |
startTimer(LuaClosure closure,
float delaySeconds,
float intervalSeconds,
int repeatCount,
java.lang.String name)
Start a timer and execute the callback when expired.
|
void |
stop()
Cancels the timer
|
public void stop()
public void cancel()
public static Timer startTimer(LuaClosure closure, float delaySeconds, float intervalSeconds, int repeatCount, java.lang.String name)
closure - The callback to be executed on expiry. No arguments are passeddelaySeconds - Delay before the timer expiresintervalSeconds - Delay after the first intervalrepeatCount - Number of repeats, set to 0 to not repeatpublic static Timer startCounterTimer(LuaClosure closure, float delaySeconds, float intervalSeconds, int repeatCount, java.lang.String name)
closure - The callback to be executed on expiry. No arguments are passeddelaySeconds - Delay before the timer expiresintervalSeconds - Delay after the first intervalrepeatCount - Number of repeats, set to 0 to not repeatpublic static Timer startCounterTimerForPeer(LuaClosure closure, float delaySeconds, float intervalSeconds, int repeatCount, java.lang.String name, Peer peer)
closure - The callback to be executed on expiry. No arguments are passeddelaySeconds - Delay before the timer expiresintervalSeconds - Delay after the first intervalrepeatCount - Number of repeats, set to 0 to not repeatpublic static Timer startCounterTimerForPeer(LuaClosure closure, float delaySeconds, float intervalSeconds, int repeatCount, java.lang.String name, io.lurkers.server.Peer peer)
public static Timer getTimerByName(java.lang.String name, Peer peer)
name - public static boolean hasTimer(java.lang.String name,
Peer peer)
public static void cancelAllTimers()
public static long getTimeMillis()
public static long getTimeSeconds()