Xonotic
round_handler.qh File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define round_handler_AwaitingNextRound()   (round_handler.wait)
 
#define round_handler_CountdownRunning()   (!round_handler.wait && round_handler.cnt)
 
#define round_handler_GetEndTime()   (round_handler.round_endtime)
 
#define round_handler_IsActive()   (round_handler != NULL)
 
#define round_handler_IsRoundStarted()   (!round_handler.wait && !round_handler.cnt)
 

Functions

 bool () canRoundStart
 
void round_handler_Init (float the_delay, float the_count, float the_round_timelimit)
 
void round_handler_Remove ()
 
void round_handler_Reset (float next_think)
 
void round_handler_Spawn (bool() canRoundStart_func, bool() canRoundEnd_func, void() roundStart_func)
 
 void () roundStart
 

Variables

float cnt
 
float count
 
float delay
 
float round_endtime
 
entity round_handler
 
float round_timelimit
 
bool wait
 

Macro Definition Documentation

◆ round_handler_AwaitingNextRound

#define round_handler_AwaitingNextRound ( )    (round_handler.wait)

Definition at line 21 of file round_handler.qh.

◆ round_handler_CountdownRunning

#define round_handler_CountdownRunning ( )    (!round_handler.wait && round_handler.cnt)

Definition at line 22 of file round_handler.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ round_handler_GetEndTime

#define round_handler_GetEndTime ( )    (round_handler.round_endtime)

◆ round_handler_IsActive

◆ round_handler_IsRoundStarted

Function Documentation

◆ bool()

bool ( )

◆ round_handler_Init()

void round_handler_Init ( float  the_delay,
float  the_count,
float  the_round_timelimit 
)

Definition at line 72 of file round_handler.qc.

References cnt, count, delay, entity(), fabs(), floor(), round_handler, and round_timelimit.

Referenced by CA_CheckWinner(), dom_DelayedInit(), Domination_CheckWinner(), freezetag_CheckWinner(), freezetag_Initialize(), Invasion_CheckWinner(), invasion_DelayedInit(), ons_DelayedInit(), Onslaught_CheckWinner(), REGISTER_MUTATOR(), and round_handler_Spawn().

73 {
74  entity this = round_handler;
75  this.delay = (the_delay > 0) ? the_delay : 0;
76  this.count = fabs(floor(the_count));
77  this.cnt = this.count + 1;
78  this.round_timelimit = (the_round_timelimit > 0) ? the_round_timelimit : 0;
79  round_limit = the_round_timelimit;
80 }
entity round_handler
Definition: round_handler.qh:3
entity() spawn
float cnt
Definition: powerups.qc:24
float round_timelimit
Definition: round_handler.qh:9
float delay
Definition: subs.qh:38
float count
Definition: powerups.qc:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ round_handler_Remove()

void round_handler_Remove ( )

Definition at line 120 of file round_handler.qc.

References NULL, and round_handler.

Referenced by round_handler_Think().

121 {
122  delete(round_handler);
124 }
entity round_handler
Definition: round_handler.qh:3
#define NULL
Definition: post.qh:17
+ Here is the caller graph for this function:

◆ round_handler_Reset()

void round_handler_Reset ( float  next_think)

Definition at line 109 of file round_handler.qc.

References cnt, count, entity(), nextthink, round_handler, and wait.

Referenced by reset_map(), and round_handler_Think().

110 {
111  entity this = round_handler;
112  this.wait = false;
113  if (this.count)
114  if (this.cnt < this.count + 1) this.cnt = this.count + 1;
115  this.nextthink = next_think;
116  if (next_think)
117  round_starttime = next_think + this.count;
118 }
entity round_handler
Definition: round_handler.qh:3
entity() spawn
float cnt
Definition: powerups.qc:24
float wait
Definition: subs.qh:39
float nextthink
Definition: csprogsdefs.qc:121
float count
Definition: powerups.qc:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ round_handler_Spawn()

void round_handler_Spawn ( bool()  canRoundStart_func,
bool()  canRoundEnd_func,
void()  roundStart_func 
)

Definition at line 91 of file round_handler.qc.

References backtrace, entity(), new_pure, nextthink, round_handler, round_handler_FirstThink(), round_handler_Init(), setthink, time, and wait.

Referenced by dom_DelayedInit(), freezetag_Initialize(), invasion_DelayedInit(), ons_DelayedInit(), and REGISTER_MUTATOR().

92 {
93  if (round_handler)
94  {
95  backtrace("Can't spawn round_handler again!");
96  return;
97  }
99 
101  this.canRoundStart = canRoundStart_func;
102  this.canRoundEnd = canRoundEnd_func;
103  this.roundStart = roundStart_func;
104  this.wait = false;
105  round_handler_Init(5, 5, 180);
106  this.nextthink = time;
107 }
void round_handler_FirstThink(entity this)
entity round_handler
Definition: round_handler.qh:3
entity() spawn
float wait
Definition: subs.qh:39
#define backtrace(msg)
Definition: log.qh:105
float nextthink
Definition: csprogsdefs.qc:121
#define new_pure(class)
purely logical entities (.origin doesn&#39;t work)
Definition: oo.qh:62
#define setthink(e, f)
float time
Definition: csprogsdefs.qc:16
void round_handler_Init(float the_delay, float the_count, float the_round_timelimit)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ void()

void ( )

Variable Documentation

◆ cnt

float cnt

Definition at line 7 of file round_handler.qh.

◆ count

float count

Definition at line 5 of file round_handler.qh.

◆ delay

float delay

Definition at line 4 of file round_handler.qh.

◆ round_endtime

float round_endtime

Definition at line 10 of file round_handler.qh.

Referenced by round_handler_Think().

◆ round_handler

entity round_handler

◆ round_timelimit

float round_timelimit

Definition at line 9 of file round_handler.qh.

Referenced by HUD_Timer(), round_handler_Init(), and round_handler_Think().

◆ wait

bool wait

Definition at line 6 of file round_handler.qh.