SourceMod SDK  1.7
SourceMod::ITimerSystem Class Referenceabstract
Inheritance diagram for SourceMod::ITimerSystem:
SourceMod::SMInterface

Public Member Functions

const char * GetInterfaceName ()
 Must return a string defining the interface's unique name.
 
unsigned int GetInterfaceVersion ()
 Must return an integer defining the interface's version.
 
virtual ITimer * CreateTimer (ITimedEvent *pCallbacks, float fInterval, void *pData, int flags)=0
 Creates a timed event. More...
 
virtual void KillTimer (ITimer *pTimer)=0
 Kills a timer. More...
 
virtual void FireTimerOnce (ITimer *pTimer, bool delayExec=false)=0
 Arbitrarily fires a timer. If the timer is not a repeating timer, this will also kill the timer. More...
 
virtual IMapTimerSetMapTimer (IMapTimer *pTimer)=0
 Sets the interface for dealing with map time limits. More...
 
virtual void MapTimeLeftChanged ()=0
 Notification that the map's time left has changed via a change in the time limit or a change in the game rules ( such as mp_restartgame).
 
virtual float GetTickedTime ()=0
 Returns the current universal tick time. This replacement for gpGlobals->curtime and engine->Time() correctly keeps track of ticks. More...
 
virtual void NotifyOfGameStart (float offset=0.0f)=0
 Notification that the "starting point" in the game has has changed. This does not invoke MapTimeLeftChanged() automatically. More...
 
virtual bool GetMapTimeLeft (float *pTime)=0
 Returns the time left in the map. More...
 
virtual IMapTimerGetMapTimer ()=0
 Returns the interface for dealing with map time limits. More...
 
- Public Member Functions inherited from SourceMod::SMInterface
virtual bool IsVersionCompatible (unsigned int version)
 Must return whether the requested version number is backwards compatible. Note: This can be overridden for breaking changes or custom versioning. More...
 

Member Function Documentation

virtual ITimer* SourceMod::ITimerSystem::CreateTimer ( ITimedEvent pCallbacks,
float  fInterval,
void *  pData,
int  flags 
)
pure virtual

Creates a timed event.

Parameters
pCallbacksPointer to ITimedEvent callbacks.
fIntervalInterval, in seconds, of the timed event to occur. The smallest allowed interval is 0.1 seconds.
pDataPrivate data to pass on to the timer.
flagsExtra flags to pass on to the timer.
Returns
An ITimer pointer on success, NULL on failure.
virtual void SourceMod::ITimerSystem::FireTimerOnce ( ITimer *  pTimer,
bool  delayExec = false 
)
pure virtual

Arbitrarily fires a timer. If the timer is not a repeating timer, this will also kill the timer.

Parameters
pTimerPointer to the ITimer structure.
delayExecIf true, and the timer is repeating, the next execution will be delayed by its interval.
Returns
virtual bool SourceMod::ITimerSystem::GetMapTimeLeft ( float *  pTime)
pure virtual

Returns the time left in the map.

Parameters
pTimePointer to store time left, in seconds. If there is no time limit, the number will be below 0.
Returns
True on success, false if no support.
virtual IMapTimer* SourceMod::ITimerSystem::GetMapTimer ( )
pure virtual

Returns the interface for dealing with map time limits.

Returns
Map timer interface.
virtual float SourceMod::ITimerSystem::GetTickedTime ( )
pure virtual

Returns the current universal tick time. This replacement for gpGlobals->curtime and engine->Time() correctly keeps track of ticks.

During simulation, it is incremented by the difference between gpGlobals->curtime and the last simulated tick. Otherwise, it is incremented by the interval per tick.

It is not reset past map changes.

Returns
Universal ticked time.
virtual void SourceMod::ITimerSystem::KillTimer ( ITimer *  pTimer)
pure virtual

Kills a timer.

Parameters
pTimerPointer to the ITimer structure.
Returns
virtual void SourceMod::ITimerSystem::NotifyOfGameStart ( float  offset = 0.0f)
pure virtual

Notification that the "starting point" in the game has has changed. This does not invoke MapTimeLeftChanged() automatically.

Parameters
offsetOptional offset to add to the new time.
virtual IMapTimer* SourceMod::ITimerSystem::SetMapTimer ( IMapTimer pTimer)
pure virtual

Sets the interface for dealing with map time limits.

Parameters
pMapTimerMap timer interface pointer.
Returns
Old pointer.

The documentation for this class was generated from the following file: