Nuclide
Software Development Kit for id Tech
NSTimer Class Reference

This class provides a way to trigger a function in the future. More...

#include <NSTimer.h>

Inheritance diagram for NSTimer:
NSEntity

Public Member Functions

void NSTimer (void)
 
virtual void RunTimer (void)
 Runs the timer that's set up. More...
 
nonvirtual void StopTimer (void)
 Invalidates the timer when called. More...
 
virtual void OnRemoveEntity (void)
 Handles what happens before the entity gets removed from the client game. More...
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle. More...
 
virtual void Restore (string, string)
 Similar to NSIO::SpawnKey but for save-game fields. More...
 

Static Public Member Functions

static NSTimer ScheduleTimer (entity, void(), float, bool)
 When called, creates and sets up a new timer, starts immediately. More...
 
static NSTimer TemporaryTimer (entity, void(), float, bool)
 When called, creates a self garbage collecting version of a timer. More...
 
static NSTimer SetupTimer (entity, void(), float, bool)
 When called, sets up a timer that has to be run manually later. More...
 

Detailed Description

This class provides a way to trigger a function in the future.

It has the ability to clean itself up afterwards, too.

Constructor & Destructor Documentation

◆ NSTimer()

void NSTimer::NSTimer ( void  )

Member Function Documentation

◆ OnRemoveEntity()

void NSTimer::OnRemoveEntity ( void  )
virtual

Handles what happens before the entity gets removed from the client game.

Reimplemented from NSEntity.

◆ Restore()

void NSTimer::Restore ( string  strKey,
string  strValue 
)
virtual

Similar to NSIO::SpawnKey but for save-game fields.

Whatever you write into file handles within your NSIO::Save() method needs to be read back in here.

Reimplemented from NSEntity.

◆ RunTimer()

void NSTimer::RunTimer ( void  )
virtual

Runs the timer that's set up.

◆ Save()

void NSTimer::Save ( float  handle)
virtual

Handles saving a copy of this entity to a given filehandle.

Within you want to use the NSIO::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.

Reimplemented from NSEntity.

◆ ScheduleTimer()

NSTimer NSTimer::ScheduleTimer ( entity  receiver,
void()  call,
float  interval,
bool  repeats 
)
static

When called, creates and sets up a new timer, starts immediately.

◆ SetupTimer()

NSTimer NSTimer::SetupTimer ( entity  receiver,
void()  call,
float  interval,
bool  repeats 
)
static

When called, sets up a timer that has to be run manually later.

◆ StopTimer()

void NSTimer::StopTimer ( void  )

Invalidates the timer when called.

◆ TemporaryTimer()

NSTimer NSTimer::TemporaryTimer ( entity  receiver,
void()  call,
float  interval,
bool  repeats 
)
static

When called, creates a self garbage collecting version of a timer.


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