// Maximal number of simultaneously running timers (not related to built-in AGS limit).
#define MAX_RUNNING_TIMERS 20
// Local timer behavior when room has changed
enum LocalTimerBehavior
{
eTimerPause,
eTimerStop
};
// Flags determining the reason for timer's pause (can be combined using bitwise OR)
#define TIMER_PAUSED_BY_USER 1
#define TIMER_PAUSED_BY_GAME 2
#define TIMER_PAUSED_BY_ROOM 4
//
// General operations.
//
/// Start the timer, giving timeout in game ticks.
static Timer *Timer.Start(int timeout, RepeatStyle repeat = eOnce);
/// Start the timer, giving timeout in real time (seconds).
/// Remember that timer can be only as precise as your GameSpeed (40 checks per
/// second, or 0.025s by default).
static Timer *Timer.StartRT(float timeout_s, RepeatStyle repeat = eOnce);
/// Starts local timer working in game ticks, that may be paused when player leaves the room
static Timer *Timer.StartLocal(int timeout, LocalTimerBehavior on_leave = eTimerStop, RepeatStyle repeat = eOnce);
/// Starts local timer working in real time (seconds), that may be paused when player leaves the room
static Timer *Timer.StartLocalRT(float timeout_s, LocalTimerBehavior on_leave = eTimerStop, RepeatStyle repeat = eOnce);
/// Tells whether timer has JUST expired. Safe to pass null-pointer.
static bool Timer.IsExpired(Timer *t);
/// Stops the running timer. Safe to pass null-pointer.
static void Timer.Stop(Timer *t);
/// Pause the running timer. Safe to pass null-pointer.
static void Timer.Pause(Timer *t);
/// Resume the running timer. Safe to pass null-pointer.
static void Timer.Resume(Timer *t);
//
// Additional setup.
//
/// Gets/sets whether all timers should pause when game is paused
static bool Timer.AllPauseWithGame;
/// Gets/sets whether this particular timer should pause when game is paused
bool Timer.PauseWithGame;
//
// Current state inspection.
//
/// Tells whether timer is currently active (counting down).
readonly bool Timer.IsActive;
/// Signal property telling that the timer has expired. This flag will remain set
/// for one game tick only and self-reset afterwards.
readonly bool Timer.EvtExpired;
/// Gets the home room of the local timer (returns -1 if timer is global)
readonly int Timer.HomeRoom;
/// Gets what this timer should do when home room gets unloaded
readonly LocalTimerBehavior Timer.WhenLeavingRoom;
/// Gets whether this timer is working in real-time
readonly bool Timer.IsRealtime;
/// Gets the timer's timeout in game ticks
readonly int Timer.TimeoutTicks;
/// Gets the timer's timeout in real-time (considering current game speed)
readonly float Timer.TimeoutSeconds;
/// Gets the remaining time in current game ticks
readonly int Timer.RemainingTicks;
/// Gets the remaining time in real-time (considering current game speed)
readonly float Timer.RemainingSeconds;
/// Gets current timer's paused state (0 - working, >= 1 - suspended)
readonly int Timer.IsPaused;