Freeciv-3.3: /fast/freeciv/nightly/main/server/score.c Source File

Freeciv-3.3

Loading...
Searching...
No Matches
score.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2003 - The Freeciv Project
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <stdio.h>
19#include <string.h>
20
21/* utility */
22#include "bitvector.h"
23#include "log.h"
24#include "mem.h"
25#include "shared.h"
26
27/* common */
28#include "culture.h"
29#include "game.h"
30#include "improvement.h"
31#include "map.h"
32#include "player.h"
33#include "research.h"
34#include "specialist.h"
35#include "unit.h"
36#include "unitlist.h"
37
38/* server */
39#include "plrhand.h"
40#include "score.h"
41#include "srv_main.h"
42
43static int get_spaceship_score(const struct player *pplayer);
44
45/**************************************************************************
46 Allocates, fills and returns a land area claim map.
47 Call free_landarea_map(&cmap) to free allocated memory.
48**************************************************************************/
49
50#define USER_AREA_MULT 1000
51
52 struct claim_map {
53 struct {
54 int landarea, settledarea;
55 } player[MAX_NUM_PLAYER_SLOTS];
56};
57
58/**************************************************************************
59 Land Area Debug...
60**************************************************************************/
61
62#define LAND_AREA_DEBUG 0
63
64#if LAND_AREA_DEBUG >= 2
65
66/**********************************************************************/
70static char when_char(int when)
71{
72 static char list[] = {
73 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
74 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
75 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
76 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
77 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
78 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
79 'y', 'z'
80 };
81
82 return (when >= 0 && when < sizeof(list)) ? list[when] : '?';
83}
84
85/*
86 * Writes the map_char_expr expression for each position on the map.
87 * map_char_expr is provided with the variables x, y to evaluate the
88 * position. The 'type' argument is used for formatting by printf; for
89 * instance it should be "%c" for characters. The data is printed in a
90 * native orientation to make it easier to read.
91 */
92#define WRITE_MAP_DATA(type, map_char_expr) \
93{ \
94 int nat_x, nat_y; \
95 for (nat_x = 0; nat_x < map.xsize; nat_x++) { \
96 printf("%d", nat_x % 10); \
97 } \
98 putchar('\n'); \
99 for (nat_y = 0; nat_y < map.ysize; nat_y++) { \
100 printf("%d ", nat_y % 10); \
101 for (nat_x = 0; nat_x < map.xsize; nat_x++) { \
102 int x, y; \
103 NATIVE_TO_MAP_POS(&x, &y, nat_x,nat_y); \
104 printf(type, map_char_expr); \
105 } \
106 printf(" %d\n", nat_y % 10); \
107 } \
108}
109
110/**********************************************************************/
113static void print_landarea_map(struct claim_map *pcmap, int turn)
114{
115 int p;
116
117 player_slots_iterate(pslot) {
118 if (player_slot_index(pslot) >= 32 && player_slot_is_used(pslot)) {
119 log_error("Debugging not possible! Player slots >= 32 are used.");
120 return;
121 }
122 } player_slots_iterate_end;
123
124 if (turn == 0) {
125 putchar('\n');
126 }
127
128 if (turn == 0) {
129 printf("Player Info...\n");
130
131 for (p = 0; p < player_count(); p++) {
132 printf(".know (%d)\n ", p);
133 WRITE_MAP_DATA("%c",
134 BV_ISSET(pcmap->claims[map_pos_to_index(x, y)].know,
135 p) ? 'X' : '-');
136 printf(".cities (%d)\n ", p);
137 WRITE_MAP_DATA("%c",
138 BV_ISSET(pcmap->
139 claims[map_pos_to_index(x, y)].cities,
140 p) ? 'O' : '-');
141 }
142 }
143
144 printf("Turn %d (%c)...\n", turn, when_char (turn));
145
146 printf(".whom\n ");
147 WRITE_MAP_DATA((pcmap->claims[map_pos_to_index(x, y)].whom ==
148 32) ? "%c" : "%X",
149 (pcmap->claims[map_pos_to_index(x, y)].whom ==
150 32) ? '-' : pcmap->claims[map_pos_to_index(x, y)].whom);
151
152 printf(".when\n ");
153 WRITE_MAP_DATA("%c", when_char(pcmap->claims[map_pos_to_index(x, y)].when));
154}
155
156#endif /* LAND_AREA_DEBUG > 2 */
157
158/**********************************************************************/
161 static void build_landarea_map(struct claim_map *pcmap)
162{
163 bv_player *claims = fc_calloc(MAP_INDEX_SIZE, sizeof(*claims));
164 const struct civ_map *nmap = &(wld.map);
165
166 memset(pcmap, 0, sizeof(*pcmap));
167
168 /* First calculate claims: which tiles are owned by each player. */
169 players_iterate(pplayer) {
170 city_list_iterate(pplayer->cities, pcity) {
171 struct tile *pcenter = city_tile(pcity);
172
173 city_tile_iterate(nmap, city_map_radius_sq_get(pcity), pcenter, tile1) {
174 BV_SET(claims[tile_index(tile1)], player_index(city_owner(pcity)));
175 } city_tile_iterate_end;
176 } city_list_iterate_end;
177 } players_iterate_end;
178
179 whole_map_iterate(nmap, ptile) {
180 struct player *owner = nullptr;
181 bv_player *pclaim = &claims[tile_index(ptile)];
182
183 if (is_ocean_tile(ptile)) {
184 /* Nothing. */
185 } else if (tile_city(ptile) != nullptr) {
186 owner = city_owner(tile_city(ptile));
187 pcmap->player[player_index(owner)].settledarea++;
188 } else if (tile_worked(ptile) != nullptr) {
189 owner = city_owner(tile_worked(ptile));
190 pcmap->player[player_index(owner)].settledarea++;
191 } else if (unit_list_size(ptile->units) > 0) {
192 /* Because of allied stacking these calculations are a bit off. */
193 owner = unit_owner(unit_list_get(ptile->units, 0));
194 if (BV_ISSET(*pclaim, player_index(owner))) {
195 pcmap->player[player_index(owner)].settledarea++;
196 }
197 }
198
199 if (BORDERS_DISABLED != game.info.borders) {
200 /* If borders are enabled, use owner information directly from the
201 * map. Otherwise use the calculations above. */
202 owner = tile_owner(ptile);
203 }
204 if (owner) {
205 pcmap->player[player_index(owner)].landarea++;
206 }
207 } whole_map_iterate_end;
208
209 FC_FREE(claims);
210
211#if LAND_AREA_DEBUG >= 2
212 print_landarea_map(pcmap, turn);
213#endif
214}
215
216/**********************************************************************/
219 static void get_player_landarea(struct claim_map *pcmap,
220 struct player *pplayer,
221 int *return_landarea,
222 int *return_settledarea)
223{
224 if (pcmap && pplayer) {
225#if LAND_AREA_DEBUG >= 1
226 printf("%-14s", player_name(pplayer));
227#endif
228 if (return_landarea) {
229 *return_landarea
230 = USER_AREA_MULT * pcmap->player[player_index(pplayer)].landarea;
231#if LAND_AREA_DEBUG >= 1
232 printf(" l=%d", *return_landarea / USER_AREA_MULT);
233#endif
234 }
235 if (return_settledarea) {
236 *return_settledarea
237 = USER_AREA_MULT * pcmap->player[player_index(pplayer)].settledarea;
238#if LAND_AREA_DEBUG >= 1
239 printf(" s=%d", *return_settledarea / USER_AREA_MULT);
240#endif
241 }
242#if LAND_AREA_DEBUG >= 1
243 printf("\n");
244#endif
245 }
246}
247
248/**********************************************************************/
251 void calc_civ_score(struct player *pplayer)
252{
253 const struct research *presearch;
254 struct city *wonder_city;
255 int landarea = 0, settledarea = 0;
256 static struct claim_map cmap;
257
258 pplayer->score.happy = 0;
259 pplayer->score.content = 0;
260 pplayer->score.unhappy = 0;
261 pplayer->score.angry = 0;
262 specialist_type_iterate(sp) {
263 pplayer->score.specialists[sp] = 0;
264 } specialist_type_iterate_end;
265 pplayer->score.wonders = 0;
266 pplayer->score.techs = 0;
267 pplayer->score.techout = 0;
268 pplayer->score.landarea = 0;
269 pplayer->score.settledarea = 0;
270 pplayer->score.population = 0;
271 pplayer->score.cities = 0;
272 pplayer->score.units = 0;
273 pplayer->score.pollution = 0;
274 pplayer->score.bnp = 0;
275 pplayer->score.mfg = 0;
276 pplayer->score.literacy = 0;
277 pplayer->score.spaceship = 0;
278 pplayer->score.culture = player_culture(pplayer);
279
280 if (is_barbarian(pplayer)) {
281 return;
282 }
283
284 city_list_iterate(pplayer->cities, pcity) {
285 int bonus;
286
287 pplayer->score.happy += pcity->feel[CITIZEN_HAPPY][FEELING_FINAL];
288 pplayer->score.content += pcity->feel[CITIZEN_CONTENT][FEELING_FINAL];
289 pplayer->score.unhappy += pcity->feel[CITIZEN_UNHAPPY][FEELING_FINAL];
290 pplayer->score.angry += pcity->feel[CITIZEN_ANGRY][FEELING_FINAL];
291 specialist_type_iterate(sp) {
292 pplayer->score.specialists[sp] += pcity->specialists[sp];
293 } specialist_type_iterate_end;
294 pplayer->score.population += city_population(pcity);
295 pplayer->score.cities++;
296 pplayer->score.pollution += pcity->pollution;
297 pplayer->score.techout += pcity->prod[O_SCIENCE];
298 pplayer->score.bnp += pcity->surplus[O_TRADE];
299 pplayer->score.mfg += pcity->surplus[O_SHIELD];
300
301 bonus = get_final_city_output_bonus(pcity, O_SCIENCE) - 100;
302 bonus = CLIP(0, bonus, 100);
303 pplayer->score.literacy += (city_population(pcity) * bonus) / 100;
304 } city_list_iterate_end;
305
306 build_landarea_map(&cmap);
307
308 get_player_landarea(&cmap, pplayer, &landarea, &settledarea);
309 pplayer->score.landarea = landarea;
310 pplayer->score.settledarea = settledarea;
311
312 presearch = research_get(pplayer);
313 advance_index_iterate(A_FIRST, i) {
314 if (valid_advance_by_number(i) != nullptr
315 && research_invention_state(presearch, i) == TECH_KNOWN) {
316 pplayer->score.techs++;
317 }
318 } advance_index_iterate_end;
319 pplayer->score.techs += research_get(pplayer)->future_tech * 5 / 2;
320
321 unit_list_iterate(pplayer->units, punit) {
322 if (!is_special_unit(punit)) { /* TODO: Which units really should count? */
323 pplayer->score.units++;
324 }
325 } unit_list_iterate_end;
326
327 improvement_iterate(i) {
328 if (is_great_wonder(i)
329 && (wonder_city = city_from_great_wonder(i))
330 && player_owns_city(pplayer, wonder_city)) {
331 pplayer->score.wonders++;
332 }
333 } improvement_iterate_end;
334
335 pplayer->score.spaceship = pplayer->spaceship.state;
336
337 pplayer->score.game = get_civ_score(pplayer);
338}
339
340/**********************************************************************/
343 static int get_units_score(const struct player *pplayer)
344{
345 return (pplayer->score.units_built / 10
346 + pplayer->score.units_killed / 3);
347}
348
349/**********************************************************************/
352 int get_civ_score(const struct player *pplayer)
353{
354 /* We used to count pplayer->score.happy here too, but this is too easily
355 * manipulated by players at the endturn. */
356 return (total_player_citizens(pplayer)
357 + pplayer->score.techs * 2
358 + pplayer->score.wonders * 5
359 + get_spaceship_score(pplayer)
360 + get_units_score(pplayer)
361 + pplayer->score.culture / 50);
362}
363
364/**********************************************************************/
367 static int get_spaceship_score(const struct player *pplayer)
368{
369 if (pplayer->score.spaceship == SSHIP_ARRIVED) {
370 /* How much should a spaceship be worth?
371 * This gives 100 points per 10,000 citizens. */
372 return (int)((pplayer->spaceship.population
373 * pplayer->spaceship.success_rate) / 100.0);
374 } else {
375 return 0;
376 }
377}
378
379/**********************************************************************/
382 int total_player_citizens(const struct player *pplayer)
383{
384 int count = (pplayer->score.happy
385 + pplayer->score.content
386 + pplayer->score.unhappy
387 + pplayer->score.angry);
388
389 specialist_type_iterate(sp) {
390 count += pplayer->score.specialists[sp];
391 } specialist_type_iterate_end;
392
393 return count;
394}
395
396/**********************************************************************/
417 void rank_users(bool interrupt)
418{
419 FILE *fp;
420 int i, t_winner_score = 0;
421 enum victory_state { VS_NONE, VS_LOSER, VS_WINNER };
422 enum victory_state plr_state[player_slot_count()];
423 struct player *spacerace_winner = nullptr;
424 struct team *t_winner = nullptr;
425
426 /* Don't output ranking info if we haven't enabled it via cmdline */
427 if (!srvarg.ranklog_filename) {
428 return;
429 }
430
431 fp = fc_fopen(srvarg.ranklog_filename, "w");
432
433 /* Don't fail silently, at least print an error */
434 if (!fp) {
435 log_error("couldn't open ranking log file: \"%s\"",
436 srvarg.ranklog_filename);
437 return;
438 }
439
440 /* Initialize plr_state */
441 for (i = 0; i < player_slot_count(); i++) {
442 plr_state[i] = VS_NONE;
443 }
444
445 /* Do we have a spacerace winner? */
446 players_iterate(pplayer) {
447 if (pplayer->spaceship.state == SSHIP_ARRIVED) {
448 spacerace_winner = pplayer;
449 break;
450 }
451 } players_iterate_end;
452
453 /* Make this easy: If we have a spacerace winner, then treat all others
454 * who are still alive as surrendered */
455 if (spacerace_winner) {
456 players_iterate(pplayer) {
457 if (pplayer != spacerace_winner) {
458 player_status_add(pplayer, PSTATUS_SURRENDER);
459 }
460 } players_iterate_end;
461 }
462
463 if (!interrupt) {
464 /* Game ended for a victory condition */
465
466 /* First pass: Locate those alive who haven't surrendered, set them to
467 * win; barbarians won't count, and everybody else is a loser for now. */
468 players_iterate(pplayer) {
469 if (is_barbarian(pplayer)) {
470 plr_state[player_index(pplayer)] = VS_NONE;
471 } else if (pplayer->is_alive
472 && !player_status_check(pplayer, PSTATUS_SURRENDER)) {
473 plr_state[player_index(pplayer)] = VS_WINNER;
474 } else {
475 plr_state[player_index(pplayer)] = VS_LOSER;
476 }
477 } players_iterate_end;
478
479 /* Second pass: Find the teammates of those winners, they win too. */
480 players_iterate(pplayer) {
481 if (plr_state[player_index(pplayer)] == VS_WINNER) {
482 players_iterate(aplayer) {
483 if (aplayer->team == pplayer->team) {
484 plr_state[player_index(aplayer)] = VS_WINNER;
485 }
486 } players_iterate_end;
487 }
488 } players_iterate_end;
489 } else {
490
491 /* Game ended via endturn */
492 /* i) Determine the winner team */
493 teams_iterate(pteam) {
494 int t_score = 0;
495 const struct player_list *members = team_members(pteam);
496
497 player_list_iterate(members, pplayer) {
498 if (pplayer->is_alive
499 && !player_status_check(pplayer, PSTATUS_SURRENDER)) {
500 t_score += get_civ_score(pplayer);
501 }
502 } player_list_iterate_end;
503 if (t_score > t_winner_score) {
504 t_winner = pteam;
505 t_winner_score = t_score;
506 }
507 } teams_iterate_end;
508
509 /* ii) Set all the members of the team as winners, the others as losers */
510 players_iterate(pplayer) {
511 if (pplayer->team == t_winner) {
512 plr_state[player_index(pplayer)] = VS_WINNER;
513 } else {
514 /* If no winner team is found (each one as same score) all them lose */
515 plr_state[player_index(pplayer)] = VS_LOSER;
516 }
517 } players_iterate_end;
518 }
519
520 /* Write out ranking information to file */
521 fprintf(fp, "turns: %d\n", game.info.turn);
522 fprintf(fp, "winners: ");
523 players_iterate(pplayer) {
524 if (plr_state[player_index(pplayer)] == VS_WINNER) {
525 fprintf(fp, "%s,%s,%s,%i,, ",
526 pplayer->ranked_username,
527 player_name(pplayer),
528 pplayer->username,
529 get_civ_score(pplayer));
530 }
531 } players_iterate_end;
532
533 fprintf(fp, "\nlosers: ");
534 players_iterate(pplayer) {
535 if (plr_state[player_index(pplayer)] == VS_LOSER) {
536 fprintf(fp, "%s,%s,%s,%i,, ",
537 pplayer->ranked_username,
538 player_name(pplayer),
539 pplayer->username,
540 get_civ_score(pplayer));
541 }
542 } players_iterate_end;
543 fprintf(fp, "\n");
544
545 fclose(fp);
546}
bitvector.h
BV_SET
#define BV_SET(bv, bit)
Definition bitvector.h:81
BV_ISSET
#define BV_ISSET(bv, bit)
Definition bitvector.h:78
city_population
int city_population(const struct city *pcity)
Definition city.c:1187
get_final_city_output_bonus
int get_final_city_output_bonus(const struct city *pcity, Output_type_id otype)
Definition city.c:2209
city_map_radius_sq_get
int city_map_radius_sq_get(const struct city *pcity)
Definition city.c:137
city_list_iterate
#define city_list_iterate(citylist, pcity)
Definition city.h:508
city_tile
#define city_tile(_pcity_)
Definition city.h:564
CITIZEN_ANGRY
@ CITIZEN_ANGRY
Definition city.h:271
CITIZEN_HAPPY
@ CITIZEN_HAPPY
Definition city.h:268
CITIZEN_CONTENT
@ CITIZEN_CONTENT
Definition city.h:269
CITIZEN_UNHAPPY
@ CITIZEN_UNHAPPY
Definition city.h:270
city_owner
#define city_owner(_pcity_)
Definition city.h:563
city_list_iterate_end
#define city_list_iterate_end
Definition city.h:510
city_tile_iterate
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
Definition city.h:230
FEELING_FINAL
@ FEELING_FINAL
Definition city.h:284
city_tile_iterate_end
#define city_tile_iterate_end
Definition city.h:238
list
static struct fc_sockaddr_list * list
Definition clinet.c:102
incite_cost
char * incite_cost
Definition comments.c:74
player_culture
int player_culture(const struct player *plr)
Definition culture.c:49
culture.h
punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
MAX_NUM_PLAYER_SLOTS
#define MAX_NUM_PLAYER_SLOTS
Definition fc_types.h:32
O_SHIELD
@ O_SHIELD
Definition fc_types.h:101
O_TRADE
@ O_TRADE
Definition fc_types.h:101
O_SCIENCE
@ O_SCIENCE
Definition fc_types.h:101
BORDERS_DISABLED
@ BORDERS_DISABLED
Definition fc_types.h:1017
game
struct civ_game game
Definition game.c:61
wld
struct world wld
Definition game.c:62
game.h
owner
struct city * owner
Definition citydlg.c:226
is_great_wonder
bool is_great_wonder(const struct impr_type *pimprove)
Definition improvement.c:772
city_from_great_wonder
struct city * city_from_great_wonder(const struct impr_type *pimprove)
Definition improvement.c:1016
improvement.h
improvement_iterate_end
#define improvement_iterate_end
Definition improvement.h:205
improvement_iterate
#define improvement_iterate(_p)
Definition improvement.h:199
log.h
log_error
#define log_error(message,...)
Definition log.h:103
map.h
map_pos_to_index
static int map_pos_to_index(struct civ_map *nmap, int map_x, int map_y)
Definition map.h:691
whole_map_iterate
#define whole_map_iterate(_map, _tile)
Definition map.h:531
whole_map_iterate_end
#define whole_map_iterate_end
Definition map.h:540
mem.h
fc_calloc
#define fc_calloc(n, esz)
Definition mem.h:38
FC_FREE
#define FC_FREE(ptr)
Definition mem.h:41
cities
struct city_list * cities
Definition packhand.c:119
player_slot_is_used
bool player_slot_is_used(const struct player_slot *pslot)
Definition player.c:448
player_count
int player_count(void)
Definition player.c:817
player_slot_count
int player_slot_count(void)
Definition player.c:418
player_name
const char * player_name(const struct player *pplayer)
Definition player.c:895
player_slot_index
int player_slot_index(const struct player_slot *pslot)
Definition player.c:426
player_index
int player_index(const struct player *pplayer)
Definition player.c:829
player_owns_city
bool player_owns_city(const struct player *pplayer, const struct city *pcity)
Definition player.c:261
player.h
players_iterate_end
#define players_iterate_end
Definition player.h:539
players_iterate
#define players_iterate(_pplayer)
Definition player.h:534
player_list_iterate
#define player_list_iterate(playerlist, pplayer)
Definition player.h:557
is_barbarian
static bool is_barbarian(const struct player *pplayer)
Definition player.h:491
player_slots_iterate
#define player_slots_iterate(_pslot)
Definition player.h:525
player_list_iterate_end
#define player_list_iterate_end
Definition player.h:559
player_slots_iterate_end
#define player_slots_iterate_end
Definition player.h:529
player_status_add
void player_status_add(struct player *plr, enum player_status pstatus)
Definition plrhand.c:3219
player_status_check
bool player_status_check(struct player *plr, enum player_status pstatus)
Definition plrhand.c:3227
plrhand.h
research_get
struct research * research_get(const struct player *pplayer)
Definition research.c:128
research_invention_state
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
Definition research.c:619
research.h
get_player_landarea
static void get_player_landarea(struct claim_map *pcmap, struct player *pplayer, int *return_landarea, int *return_settledarea)
Definition score.c:219
calc_civ_score
void calc_civ_score(struct player *pplayer)
Definition score.c:251
USER_AREA_MULT
#define USER_AREA_MULT
Definition score.c:50
get_civ_score
int get_civ_score(const struct player *pplayer)
Definition score.c:352
build_landarea_map
static void build_landarea_map(struct claim_map *pcmap)
Definition score.c:161
rank_users
void rank_users(bool interrupt)
Definition score.c:417
get_units_score
static int get_units_score(const struct player *pplayer)
Definition score.c:343
get_spaceship_score
static int get_spaceship_score(const struct player *pplayer)
Definition score.c:367
total_player_citizens
int total_player_citizens(const struct player *pplayer)
Definition score.c:382
score.h
shared.h
CLIP
#define CLIP(lower, current, upper)
Definition shared.h:57
SSHIP_ARRIVED
@ SSHIP_ARRIVED
Definition spaceship.h:85
specialist.h
specialist_type_iterate_end
#define specialist_type_iterate_end
Definition specialist.h:79
specialist_type_iterate
#define specialist_type_iterate(sp)
Definition specialist.h:73
y
struct sprite int int y
Definition sprite_g.h:31
x
struct sprite int x
Definition sprite_g.h:31
srvarg
struct server_arguments srvarg
Definition srv_main.c:181
srv_main.h
city
Definition city.h:320
civ_game::info
struct packet_game_info info
Definition game.h:89
civ_map
Definition map_types.h:71
claim_map
Definition score.c:52
claim_map::landarea
int landarea
Definition score.c:54
claim_map::settledarea
int settledarea
Definition score.c:54
packet_game_info::borders
enum borders_mode borders
Definition packets_gen.h:133
packet_game_info::turn
int turn
Definition packets_gen.h:245
player_score::units_killed
int units_killed
Definition player.h:105
player_score::landarea
int landarea
Definition player.h:94
player_score::mfg
int mfg
Definition player.h:102
player_score::population
int population
Definition player.h:96
player_score::pollution
int pollution
Definition player.h:99
player_score::wonders
int wonders
Definition player.h:91
player_score::settledarea
int settledarea
Definition player.h:95
player_score::specialists
int specialists[SP_MAX]
Definition player.h:90
player_score::angry
int angry
Definition player.h:89
player_score::techout
int techout
Definition player.h:93
player_score::game
int game
Definition player.h:110
player_score::units
int units
Definition player.h:98
player_score::units_built
int units_built
Definition player.h:104
player_score::content
int content
Definition player.h:87
player_score::happy
int happy
Definition player.h:86
player_score::spaceship
int spaceship
Definition player.h:103
player_score::culture
int culture
Definition player.h:109
player_score::unhappy
int unhappy
Definition player.h:88
player_score::cities
int cities
Definition player.h:97
player_score::bnp
int bnp
Definition player.h:101
player_score::literacy
int literacy
Definition player.h:100
player_score::techs
int techs
Definition player.h:92
player_spaceship::population
int population
Definition spaceship.h:111
player_spaceship::success_rate
double success_rate
Definition spaceship.h:115
player_spaceship::state
enum spaceship_state state
Definition spaceship.h:108
player
Definition player.h:249
player::cities
struct city_list * cities
Definition player.h:281
player::units
struct unit_list * units
Definition player.h:282
player::spaceship
struct player_spaceship spaceship
Definition player.h:286
player::score
struct player_score score
Definition player.h:283
research
Definition research.h:39
research::future_tech
int future_tech
Definition research.h:42
server_arguments::ranklog_filename
char * ranklog_filename
Definition srv_main.h:43
team
Definition team.c:40
tile
Definition tile.h:50
world::map
struct civ_map map
Definition world_object.h:38
fc_fopen
FILE * fc_fopen(const char *filename, const char *opentype)
Definition support.c:505
team_members
const struct player_list * team_members(const struct team *pteam)
Definition team.c:456
teams_iterate_end
#define teams_iterate_end
Definition team.h:87
teams_iterate
#define teams_iterate(_pteam)
Definition team.h:82
valid_advance_by_number
struct advance * valid_advance_by_number(const Tech_type_id id)
Definition tech.c:176
advance_index_iterate_end
#define advance_index_iterate_end
Definition tech.h:249
A_FIRST
#define A_FIRST
Definition tech.h:44
advance_index_iterate
#define advance_index_iterate(_start, _index)
Definition tech.h:245
is_ocean_tile
#define is_ocean_tile(ptile)
Definition terrain.h:196
tile_city
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
tile_index
#define tile_index(_pt_)
Definition tile.h:89
tile_worked
#define tile_worked(_tile)
Definition tile.h:115
tile_owner
#define tile_owner(_tile)
Definition tile.h:97
is_special_unit
bool is_special_unit(const struct unit *punit)
Definition unit.c:353
unit.h
unit_owner
#define unit_owner(_pu)
Definition unit.h:396
unitlist.h
unit_list_iterate
#define unit_list_iterate(unitlist, punit)
Definition unitlist.h:31
unit_list_iterate_end
#define unit_list_iterate_end
Definition unitlist.h:33
MAP_INDEX_SIZE
#define MAP_INDEX_SIZE
Definition world_object.h:52