Nuclide
Software Development Kit for id Technology (BETA)
Loading...
Searching...
No Matches
Timer.h
1/*
2 * Copyright (c) 2022 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
17.void(void) _m_ncTimerFunc;
18
24class
26{
27public:
28 void ncTimer(void);
29
31 static ncTimer ScheduleTimer(entity, void(), float, bool);
32
34 static ncTimer TemporaryTimer(entity, void(), float, bool);
35
37 virtual void RunTimer(void);
38
40 static ncTimer SetupTimer(entity, void(), float, bool);
41
43 nonvirtual void StopTimer(void);
44
45 virtual void OnRemoveEntity(void);
46
47#ifdef SERVER
48 virtual void Save(float);
49 virtual void Restore(string, string);
50#endif
51
52private:
53 entity m_eReceiver;
54 float m_flTime;
55 bool m_bRepeats;
56
57 virtual void _TimerThink(void);
58 virtual void _TempTimerThink(void);
59};
void ncEntity(void)
The constructor.
Definition Entity.qc:29
virtual void Restore(string, string)
Similar to ncIO::SpawnKey() but for save-game fields.
Definition Timer.qc:140
static ncTimer ScheduleTimer(entity, void(), float, bool)
When called, creates and sets up a new timer, starts immediately.
Definition Timer.qc:64
nonvirtual void StopTimer(void)
Invalidates the timer when called.
Definition Timer.qc:120
virtual void RunTimer(void)
Runs the timer that's set up.
Definition Timer.qc:95
virtual void OnRemoveEntity(void)
Handles what happens before the entity gets removed from the client game.
Definition Timer.qc:113
void ncTimer(void)
Definition Timer.qc:18
static ncTimer TemporaryTimer(entity, void(), float, bool)
When called, creates a self garbage collecting version of a timer.
Definition Timer.qc:80
static ncTimer SetupTimer(entity, void(), float, bool)
When called, sets up a timer that has to be run manually later.
Definition Timer.qc:102
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition Timer.qc:130