3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is not open source and may not be copied without explicit
8 * written permission of AlliedModders LLC. This file may not be redistributed
9 * in whole or significant part.
10 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
15 #ifndef _INCLUDE_SOURCEMOD_CTIMERSYS_H_
16 #define _INCLUDE_SOURCEMOD_CTIMERSYS_H_
19 #include <ITimerSystem.h>
22 #include "sourcemm_api.h"
24 using namespace SourceHook;
25 using namespace SourceMod;
27 typedef List<ITimer *> TimerList;
28 typedef List<ITimer *>::iterator TimerIter;
30 class SourceMod::ITimer
33 void Initialize(ITimedEvent *pCallbacks, float fInterval, float fToExec, void *pData, int flags);
34 ITimedEvent *m_Listener;
49 public: //SMGlobalClass
50 void OnSourceModAllInitialized();
51 public: //ITimerSystem
52 ITimer *CreateTimer(ITimedEvent *pCallbacks, float fInterval, void *pData, int flags);
53 void KillTimer(ITimer *pTimer);
54 void FireTimerOnce(ITimer *pTimer, bool delayExec=false);
59 List<ITimer *> m_SingleTimers;
60 List<ITimer *> m_LoopTimers;
61 CStack<ITimer *> m_FreeTimers;
65 extern TimerSystem g_Timers;
67 #endif //_INCLUDE_SOURCEMOD_CTIMERSYS_H_