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

Go to the source code of this file.

Macros

#define IS_DECREASING(x)   ( !((x) & SFL_LOWER_IS_BETTER) )
 
#define IS_INCREASING(x)   ( (x) & SFL_LOWER_IS_BETTER )
 
#define MAX_SCORE   64
 
#define MAX_TEAMSCORE   2
 
#define REGISTER_SP(id)   REGISTER(Scores, SP, id, m_id, new_pure(PlayerScoreField))
 
#define scores(this)   _scores[(this).m_id]
 
#define scores_flags(this)   ((this).m_flags)
 
#define scores_label(this)   ((this).m_name)
 
#define SFL_ZERO_IS_WORST   SFL_TIME
 
#define teamscores(i)   _teamscores[i]
 
#define teamscores_flags(i)   _teamscores_flags[i]
 
#define teamscores_label(i)   _teamscores_label[i]
 

Typedefs

using PlayerScoreField = entity
 
using ScoreTeam = string
 

Functions

 REGISTRY (Scores, MAX_SCORE)
 
 REGISTRY_CHECK (Scores)
 
 REGISTRY_SORT (Scores)
 
 STATIC_INIT (Scores_renumber)
 

Variables

int _scores [MAX_SCORE]
 
int _teamscores [MAX_TEAMSCORE]
 
int _teamscores_flags [MAX_TEAMSCORE]
 
string _teamscores_label [MAX_TEAMSCORE]
 
int m_flags
 
string m_name
 
const int SFL_ALLOW_HIDE = BIT(4)
 Allow a column to be hidden (do not automatically add it even if it is a sorting key) More...
 
const int SFL_HIDE_ZERO = BIT(1)
 Don't show zero values as scores. More...
 
const int SFL_LOWER_IS_BETTER = BIT(0)
 Lower scores are better (e.g. More...
 
const int SFL_RANK = BIT(5)
 Display as a rank (with st, nd, rd, th suffix) More...
 
const int SFL_SORT_PRIO_MASK = 12
 
const int SFL_SORT_PRIO_PRIMARY = 8
 
const int SFL_SORT_PRIO_SECONDARY = 4
 Scoring priority (NOTE: PRIMARY is used for fraglimit) More...
 
const int SFL_TIME = BIT(6)
 Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!) More...
 
const int ST_SCORE = 0
 

Macro Definition Documentation

◆ IS_DECREASING

#define IS_DECREASING (   x)    ( !((x) & SFL_LOWER_IS_BETTER) )

Definition at line 131 of file scores.qh.

Referenced by Scoreboard_CompareScore().

◆ IS_INCREASING

#define IS_INCREASING (   x)    ( (x) & SFL_LOWER_IS_BETTER )

Definition at line 130 of file scores.qh.

Referenced by Scoreboard_CompareScore().

◆ MAX_SCORE

#define MAX_SCORE   64

Definition at line 3 of file scores.qh.

◆ MAX_TEAMSCORE

◆ REGISTER_SP

#define REGISTER_SP (   id)    REGISTER(Scores, SP, id, m_id, new_pure(PlayerScoreField))

Definition at line 5 of file scores.qh.

Referenced by STATIC_INIT().

◆ scores

#define scores (   this)    _scores[(this).m_id]

◆ scores_flags

◆ scores_label

◆ SFL_ZERO_IS_WORST

#define SFL_ZERO_IS_WORST   SFL_TIME

◆ teamscores

#define teamscores (   i)    _teamscores[i]

◆ teamscores_flags

◆ teamscores_label

Typedef Documentation

◆ PlayerScoreField

Definition at line 133 of file scores.qh.

◆ ScoreTeam

using ScoreTeam = string

Definition at line 143 of file scores.qh.

Function Documentation

◆ REGISTRY()

REGISTRY ( Scores  ,
MAX_SCORE   
)

◆ REGISTRY_CHECK()

REGISTRY_CHECK ( Scores  )

◆ REGISTRY_SORT()

REGISTRY_SORT ( Scores  )

◆ STATIC_INIT()

STATIC_INIT ( Scores_renumber  )

Definition at line 12 of file scores.qh.

References FOREACH, and REGISTER_SP.

12 { FOREACH(Scores, true, it.m_id = i); }
#define FOREACH(list, cond, body)
Definition: iter.qh:19

Variable Documentation

◆ _scores

int _scores[MAX_SCORE]

Definition at line 134 of file scores.qh.

◆ _teamscores

int _teamscores[MAX_TEAMSCORE]

Definition at line 144 of file scores.qh.

◆ _teamscores_flags

int _teamscores_flags[MAX_TEAMSCORE]

Definition at line 148 of file scores.qh.

◆ _teamscores_label

string _teamscores_label[MAX_TEAMSCORE]

Definition at line 146 of file scores.qh.

◆ m_flags

int m_flags

Definition at line 136 of file scores.qh.

◆ m_name

◆ SFL_ALLOW_HIDE

const int SFL_ALLOW_HIDE = BIT(4)

Allow a column to be hidden (do not automatically add it even if it is a sorting key)

Definition at line 108 of file scores.qh.

Referenced by Cmd_Scoreboard_SetFields(), and REGISTER_MUTATOR().

◆ SFL_HIDE_ZERO

const int SFL_HIDE_ZERO = BIT(1)

Don't show zero values as scores.

Definition at line 103 of file scores.qh.

Referenced by depthfirst().

◆ SFL_LOWER_IS_BETTER

◆ SFL_RANK

const int SFL_RANK = BIT(5)

Display as a rank (with st, nd, rd, th suffix)

Definition at line 113 of file scores.qh.

Referenced by depthfirst(), and REGISTER_MUTATOR().

◆ SFL_SORT_PRIO_MASK

◆ SFL_SORT_PRIO_PRIMARY

◆ SFL_SORT_PRIO_SECONDARY

◆ SFL_TIME

const int SFL_TIME = BIT(6)

Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)

Definition at line 118 of file scores.qh.

Referenced by ctf_ScoreRules(), cts_ScoreRules(), depthfirst(), HUD_Mod_Race(), HUD_Score(), and race_ScoreRules().

◆ ST_SCORE

const int ST_SCORE = 0

Definition at line 151 of file scores.qh.

Referenced by ctf_Handle_Return(), dompointthink(), and ScoreRules_basics().