public/ITimerSystem.h
changeset 1407 bb6516a50eea
parent 1330 ab94316bb52b
child 1414 bb258bffc7df
     1.1 --- a/public/ITimerSystem.h	Tue Sep 11 15:10:18 2007 +0000
     1.2 +++ b/public/ITimerSystem.h	Tue Sep 11 18:02:59 2007 +0000
     1.3 @@ -48,6 +48,8 @@
     1.4  {
     1.5  	class ITimer;
     1.6  
     1.7 +	typedef float (*SM_TIMELEFT_FUNCTION)();
     1.8 +
     1.9  	/**
    1.10  	 * @brief Event callbacks for when a timer is executed.
    1.11  	 */
    1.12 @@ -74,6 +76,10 @@
    1.13  
    1.14  	#define TIMER_FLAG_REPEAT			(1<<0)		/**< Timer will repeat until stopped */
    1.15  	#define TIMER_FLAG_NO_MAPCHANGE		(1<<1)		/**< Timer will not carry over mapchanges */
    1.16 +	#define TIMER_FLAG_BEFORE_MAP_END	(1<<2)		/**< Timer will fire <interval> seconds before map end.
    1.17 +														 This flag is cannot be used with REPEAT, 
    1.18 +														 and TIMER_FLAG_NO_MAPCHANGE is implied.
    1.19 +														 */
    1.20  
    1.21  	class ITimerSystem : public SMInterface
    1.22  	{
    1.23 @@ -95,7 +101,8 @@
    1.24  		 *							The smallest allowed interval is 0.1 seconds.
    1.25  		 * @param pData				Private data to pass on to the timer.
    1.26  		 * @param flags				Extra flags to pass on to the timer.
    1.27 -		 * @return					An ITimer pointer on success, NULL on failure.
    1.28 +		 * @return					An ITimer pointer on success, NULL on 
    1.29 +		 *							failure.
    1.30  		 */
    1.31  		virtual ITimer *CreateTimer(ITimedEvent *pCallbacks, 
    1.32  										 float fInterval, 
    1.33 @@ -116,11 +123,21 @@
    1.34  		 *
    1.35  		 * @param pTimer			Pointer to the ITimer structure.
    1.36  		 * @param delayExec			If true, and the timer is repeating, the
    1.37 -		 *							next execution will be delayed by its interval.
    1.38 +		 *							next execution will be delayed by its 
    1.39 +		 *							interval.
    1.40  		 * @return
    1.41  		 */
    1.42  		virtual void FireTimerOnce(ITimer *pTimer, bool delayExec=false) =0;
    1.43 +
    1.44 +		/**
    1.45 +		 * @brief Sets the function which is used to find the time left in the map.
    1.46 +		 *
    1.47 +		 * @param fn				Function that returns the time left in seconds.
    1.48 +		 * @return					The previous SM_TIMELEFT_FUNCTION pointer.
    1.49 +		 */
    1.50 +		virtual SM_TIMELEFT_FUNCTION SetTimeLeftFunction(SM_TIMELEFT_FUNCTION fn) =0;
    1.51  	};
    1.52  }
    1.53  
    1.54  #endif //_INCLUDE_SOURCEMOD_TIMER_SYSTEM_H_
    1.55 +