Nuclide
Software Development Kit for id Technology (BETA)
ncTimer Class Reference

About this class

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

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

Inheritance diagram for ncTimer:
ncEntity

Public Member Functions

void ncTimer (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 ncIO::SpawnKey() but for save-game fields. More...
 

Static Public Member Functions

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

Constructor & Destructor Documentation

◆ ncTimer()

void ncTimer::ncTimer ( void  )

Member Function Documentation

◆ OnRemoveEntity()

void ncTimer::OnRemoveEntity ( void  )
virtual

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

Reimplemented from ncIO.

◆ Restore()

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

Similar to ncIO::SpawnKey() but for save-game fields.

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

Reimplemented from ncEntity.

◆ RunTimer()

void ncTimer::RunTimer ( void  )
virtual

Runs the timer that's set up.

◆ Save()

void ncTimer::Save ( float  handle)
virtual

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

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

Reimplemented from ncEntity.

◆ ScheduleTimer()

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

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

◆ SetupTimer()

ncTimer ncTimer::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 ncTimer::StopTimer ( void  )

Invalidates the timer when called.

◆ TemporaryTimer()

ncTimer ncTimer::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: