5 #define REGISTER_SP(id) REGISTER(Scores, SP, id, m_id, new_pure(PlayerScoreField))
6 REGISTRY(Scores, MAX_SCORE);
7 #define Scores_from(i) _Scores_from(i, NULL)
8 REGISTER_REGISTRY(Scores)
10 REGISTRY_CHECK(Scores);
11 STATIC_INIT(Scores_renumber) { FOREACH(Scores, true, it.m_id = i); }
26 REGISTER_SP(SEPARATOR);
31 REGISTER_SP(DMGTAKEN);
35 REGISTER_SP(SUICIDES);
40 // TODO: move to common mutators
42 REGISTER_SP(RACE_TIME);
43 REGISTER_SP(RACE_LAPS);
44 REGISTER_SP(RACE_FASTEST);
46 //REGISTER_SP(CTS_TIME);
47 //REGISTER_SP(CTS_LAPS);
48 //REGISTER_SP(CTS_FASTEST);
50 REGISTER_SP(ASSAULT_OBJECTIVES);
52 REGISTER_SP(CTF_PICKUPS);
53 REGISTER_SP(CTF_FCKILLS);
54 REGISTER_SP(CTF_RETURNS);
55 REGISTER_SP(CTF_CAPS);
56 REGISTER_SP(CTF_CAPTIME);
57 REGISTER_SP(CTF_DROPS);
59 REGISTER_SP(DOM_TAKES);
60 REGISTER_SP(DOM_TICKS);
62 REGISTER_SP(FREEZETAG_REVIVALS);
64 REGISTER_SP(KEEPAWAY_PICKUPS);
65 REGISTER_SP(KEEPAWAY_BCTIME);
66 REGISTER_SP(KEEPAWAY_CARRIERKILLS);
68 REGISTER_SP(KH_PICKUPS);
70 REGISTER_SP(KH_KCKILLS);
71 REGISTER_SP(KH_PUSHES);
72 REGISTER_SP(KH_DESTROYS);
73 REGISTER_SP(KH_LOSSES);
75 REGISTER_SP(LMS_RANK);
76 REGISTER_SP(LMS_LIVES);
78 REGISTER_SP(NEXBALL_GOALS);
79 REGISTER_SP(NEXBALL_FAULTS);
81 REGISTER_SP(ONS_TAKES);
82 REGISTER_SP(ONS_CAPS);
86 // the stuff you don't need to see
89 * Lower scores are better (e.g. suicides)
91 const int SFL_LOWER_IS_BETTER = BIT(0);
94 * Don't show zero values as scores
96 const int SFL_HIDE_ZERO = BIT(1);
99 * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
101 const int SFL_ALLOW_HIDE = BIT(4);
104 * Display as a rank (with st, nd, rd, th suffix)
106 const int SFL_RANK = BIT(5);
109 * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
111 const int SFL_TIME = BIT(6);
113 // not an extra constant yet
114 #define SFL_ZERO_IS_WORST SFL_TIME
117 * Scoring priority (NOTE: PRIMARY is used for fraglimit)
119 const int SFL_SORT_PRIO_SECONDARY = 4;
120 const int SFL_SORT_PRIO_PRIMARY = 8;
121 const int SFL_SORT_PRIO_MASK = 12;
123 #define IS_INCREASING(x) ( (x) & SFL_LOWER_IS_BETTER )
124 #define IS_DECREASING(x) ( !((x) & SFL_LOWER_IS_BETTER) )
126 USING(PlayerScoreField, entity);
127 .int _scores[MAX_SCORE];
131 #define scores(this) _scores[(this).m_id]
132 #define scores_label(this) ((this).m_name)
133 #define scores_flags(this) ((this).m_flags)
135 #define MAX_TEAMSCORE 2
136 USING(ScoreTeam, string);
137 .int _teamscores[MAX_TEAMSCORE];
138 #define teamscores(i) _teamscores[i]
139 string _teamscores_label[MAX_TEAMSCORE];
140 #define teamscores_label(i) _teamscores_label[i]
141 int _teamscores_flags[MAX_TEAMSCORE];
142 #define teamscores_flags(i) _teamscores_flags[i]
144 const int ST_SCORE = 0;