Stop sharing requirement_unit_state_ereq().
[freeciv.git] / common / fc_types.h
blob8ff8e70371721d8d308eac2999e9d580cffe741c
1 /***********************************************************************
2 Freeciv - Copyright (C) 2004 - 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.
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 ***********************************************************************/
14 #ifndef FC__FC_TYPES_H
15 #define FC__FC_TYPES_H
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
21 /* utility */
22 #include "bitvector.h"
23 #include "shared.h"
25 /* This file serves to reduce the cross-inclusion of header files which
26 * occurs when a type which is defined in one file is needed for a function
27 * definition in another file.
29 * Nothing in this file should require anything else from the common/
30 * directory! */
32 #define MAX_NUM_PLAYER_SLOTS 160 /* Used in the network protocol. */
33 /* Must be divisable by 32 or iterations
34 * in savegame2.c needs to be changed */
35 #define MAX_NUM_BARBARIANS 10 /* 3, but slots reserved for future use. */
36 #define MAX_NUM_PLAYERS MAX_NUM_PLAYER_SLOTS - MAX_NUM_BARBARIANS
37 /* Used in the network protocol. */
38 #define MAX_NUM_CONNECTIONS (2 * (MAX_NUM_PLAYER_SLOTS))
39 /* e.g. unit_types. Used in the network protocol. */
40 #define MAX_NUM_ITEMS 200
41 #define MAX_NUM_TECH_LIST 10 /* Used in the network protocol. */
42 #define MAX_NUM_UNIT_LIST 10 /* Used in the network protocol. */
43 #define MAX_NUM_BUILDING_LIST 10 /* Used in the network protocol. */
44 #define MAX_LEN_VET_SHORT_NAME 8
45 /* Used in the network protocol. See diplomat_success_vs_defender() */
46 #define MAX_VET_LEVELS 20
47 #define MAX_EXTRA_TYPES 128 /* Used in the network protocol. */
48 #define MAX_BASE_TYPES MAX_EXTRA_TYPES /* Used in the network protocol. */
49 #define MAX_ROAD_TYPES MAX_EXTRA_TYPES /* Used in the network protocol. */
50 #define MAX_GOODS_TYPES 25
51 #define MAX_DISASTER_TYPES 10
52 #define MAX_ACHIEVEMENT_TYPES 40
53 #define MAX_NUM_ACTION_AUTO_PERFORMERS 4
54 #define MAX_NUM_MULTIPLIERS 15
55 #define MAX_NUM_LEADERS MAX_NUM_ITEMS /* Used in the network protocol. */
56 #define MAX_NUM_NATION_SETS 32 /* Used in the network protocol.
57 * RULESET_NATION_SETS packet may become too big
58 * if increased */
59 #define MAX_NUM_NATION_GROUPS 128 /* Used in the network protocol. */
60 /* Used in the network protocol -- nation count is a UINT16 */
61 #define MAX_NUM_NATIONS MAX_UINT16
62 #define MAX_NUM_STARTPOS_NATIONS 1024 /* Used in the network protocol. */
63 #define MAX_CALENDAR_FRAGMENTS 52 /* Used in the network protocol. */
64 #define MAX_NUM_TECH_CLASSES 16 /* Used in the network protocol. */
66 /* Changing these will probably break network compatability. */
67 #define MAX_LEN_NAME 48
68 #define MAX_LEN_CITYNAME 80
69 #define MAX_LEN_DEMOGRAPHY 16
70 #define MAX_LEN_ALLOW_TAKE 16
71 #define MAX_LEN_GAME_IDENTIFIER 33
72 #define MAX_GRANARY_INIS 24
73 #define MAX_LEN_STARTUNIT (20+1)
74 #define MAX_LEN_ENUM 64
76 /* Line breaks after this number of characters; be carefull and use only 70 */
77 #define LINE_BREAK 70
79 /* symbol to flag missing numbers for better debugging */
80 #define IDENTITY_NUMBER_ZERO (0)
82 enum override_bool { OVERRIDE_TRUE, OVERRIDE_FALSE, NO_OVERRIDE };
84 /* A bitvector for all player slots. Used in the network protocol. */
85 BV_DEFINE(bv_player, MAX_NUM_PLAYER_SLOTS);
87 /* Changing this breaks network compatibility. */
88 enum output_type_id {
89 O_FOOD, O_SHIELD, O_TRADE, O_GOLD, O_LUXURY, O_SCIENCE, O_LAST
92 /* Changing this enum will break savegame and network compatability. */
93 #define SPECENUM_NAME unit_activity
94 #define SPECENUM_VALUE0 ACTIVITY_IDLE
95 #define SPECENUM_VALUE0NAME "Idle"
96 #define SPECENUM_VALUE1 ACTIVITY_POLLUTION
97 #define SPECENUM_VALUE1NAME "Pollution"
98 #define SPECENUM_VALUE2 ACTIVITY_OLD_ROAD
99 #define SPECENUM_VALUE2NAME "Unused Road"
100 #define SPECENUM_VALUE3 ACTIVITY_MINE
101 #define SPECENUM_VALUE3NAME "Mine"
102 #define SPECENUM_VALUE4 ACTIVITY_IRRIGATE
103 #define SPECENUM_VALUE4NAME "Irrigate"
104 #define SPECENUM_VALUE5 ACTIVITY_FORTIFIED
105 #define SPECENUM_VALUE5NAME "Fortified"
106 #define SPECENUM_VALUE6 ACTIVITY_FORTRESS
107 #define SPECENUM_VALUE6NAME "Fortress"
108 #define SPECENUM_VALUE7 ACTIVITY_SENTRY
109 #define SPECENUM_VALUE7NAME "Sentry"
110 #define SPECENUM_VALUE8 ACTIVITY_OLD_RAILROAD
111 #define SPECENUM_VALUE8NAME "Unused Railroad"
112 #define SPECENUM_VALUE9 ACTIVITY_PILLAGE
113 #define SPECENUM_VALUE9NAME "Pillage"
114 #define SPECENUM_VALUE10 ACTIVITY_GOTO
115 #define SPECENUM_VALUE10NAME "Goto"
116 #define SPECENUM_VALUE11 ACTIVITY_EXPLORE
117 #define SPECENUM_VALUE11NAME "Explore"
118 #define SPECENUM_VALUE12 ACTIVITY_TRANSFORM
119 #define SPECENUM_VALUE12NAME "Transform"
120 #define SPECENUM_VALUE13 ACTIVITY_UNKNOWN
121 #define SPECENUM_VALUE13NAME "Unused"
122 #define SPECENUM_VALUE14 ACTIVITY_AIRBASE
123 #define SPECENUM_VALUE14NAME "Unused Airbase"
124 #define SPECENUM_VALUE15 ACTIVITY_FORTIFYING
125 #define SPECENUM_VALUE15NAME "Fortifying"
126 #define SPECENUM_VALUE16 ACTIVITY_FALLOUT
127 #define SPECENUM_VALUE16NAME "Fallout"
128 #define SPECENUM_VALUE17 ACTIVITY_PATROL_UNUSED
129 #define SPECENUM_VALUE17NAME "Unused Patrol"
130 #define SPECENUM_VALUE18 ACTIVITY_BASE
131 #define SPECENUM_VALUE18NAME "Base"
132 #define SPECENUM_VALUE19 ACTIVITY_GEN_ROAD
133 #define SPECENUM_VALUE19NAME "Road"
134 #define SPECENUM_VALUE20 ACTIVITY_CONVERT
135 #define SPECENUM_VALUE20NAME "Convert"
136 #define SPECENUM_COUNT ACTIVITY_LAST
137 #include "specenum_gen.h"
139 enum adv_unit_task { AUT_NONE, AUT_AUTO_SETTLER, AUT_BUILD_CITY };
141 typedef signed short Continent_id;
142 typedef int Terrain_type_id;
143 typedef int Resource_type_id;
144 typedef int Specialist_type_id;
145 typedef int Impr_type_id;
146 typedef int Tech_type_id;
147 typedef enum output_type_id Output_type_id;
148 typedef enum unit_activity Activity_type_id;
149 typedef int Nation_type_id;
150 typedef int Government_type_id;
151 typedef int Unit_type_id;
152 typedef int Base_type_id;
153 typedef int Road_type_id;
154 typedef int Disaster_type_id;
155 typedef int Multiplier_type_id;
156 typedef int Goods_type_id;
157 typedef unsigned char citizens;
159 struct advance;
160 struct city;
161 struct connection;
162 struct government;
163 struct impr_type;
164 struct nation_type;
165 struct output_type;
166 struct player;
167 struct specialist;
168 struct terrain;
169 struct tile;
170 struct unit;
171 struct achievement;
172 struct action;
175 /* Changing these will break network compatibility. */
176 #define SP_MAX 20
177 #define MAX_NUM_REQS 20
179 #define MAX_NUM_RULESETS 16 /* Used in the network protocol. */
180 #define MAX_RULESET_NAME_LENGTH 64 /* Used in the network protocol. */
181 #define RULESET_SUFFIX ".serv"
183 /* Unit Class List, also 32-bit vector? */
184 #define UCL_LAST 32 /* Used in the network protocol. */
185 typedef int Unit_Class_id;
187 /* The direction8 gives the 8 possible directions. These may be used in
188 * a number of ways, for instance as an index into the DIR_DX/DIR_DY
189 * arrays. Not all directions may be valid; see is_valid_dir and
190 * is_cardinal_dir. */
192 /* The DIR8/direction8 naming system is used to avoid conflict with
193 * DIR4/direction4 in client/tilespec.h
195 * Changing the order of the directions will break network compatability.
197 * Some code assumes that the first 4 directions are the reverses of the
198 * last 4 (in no particular order). See client/goto.c and
199 * map.c:opposite_direction(). */
201 /* Used in the network protocol. */
202 #define SPECENUM_NAME direction8
203 #define SPECENUM_VALUE0 DIR8_NORTHWEST
204 #define SPECENUM_VALUE0NAME "Northwest"
205 #define SPECENUM_VALUE1 DIR8_NORTH
206 #define SPECENUM_VALUE1NAME "North"
207 #define SPECENUM_VALUE2 DIR8_NORTHEAST
208 #define SPECENUM_VALUE2NAME "Northeast"
209 #define SPECENUM_VALUE3 DIR8_WEST
210 #define SPECENUM_VALUE3NAME "West"
211 #define SPECENUM_VALUE4 DIR8_EAST
212 #define SPECENUM_VALUE4NAME "East"
213 #define SPECENUM_VALUE5 DIR8_SOUTHWEST
214 #define SPECENUM_VALUE5NAME "Southwest"
215 #define SPECENUM_VALUE6 DIR8_SOUTH
216 #define SPECENUM_VALUE6NAME "South"
217 #define SPECENUM_VALUE7 DIR8_SOUTHEAST
218 #define SPECENUM_VALUE7NAME "Southeast"
219 #define SPECENUM_INVALID ((enum direction8) (DIR8_SOUTHEAST + 1))
220 #include "specenum_gen.h"
222 /* No direction. Understood as the origin tile that a direction would have
223 * been relative to. */
224 #define DIR8_ORIGIN direction8_invalid()
226 /* Used in the network protocol. */
227 #define SPECENUM_NAME free_tech_method
228 #define SPECENUM_VALUE0 FTM_GOAL
229 #define SPECENUM_VALUE0NAME "Goal"
230 #define SPECENUM_VALUE1 FTM_RANDOM
231 #define SPECENUM_VALUE1NAME "Random"
232 #define SPECENUM_VALUE2 FTM_CHEAPEST
233 #define SPECENUM_VALUE2NAME "Cheapest"
234 #include "specenum_gen.h"
236 /* Some code requires compile time value for number of directions, and
237 * cannot use specenum function call direction8_max(). */
238 #define DIR8_MAGIC_MAX 8
240 /* Used in the network protocol. */
241 /* server/commands.c must match these */
242 #define SPECENUM_NAME ai_level
243 #define SPECENUM_VALUE0 AI_LEVEL_AWAY
244 #define SPECENUM_VALUE0NAME N_("Away")
245 #define SPECENUM_VALUE1 AI_LEVEL_HANDICAPPED
246 #define SPECENUM_VALUE1NAME N_("Handicapped")
247 #define SPECENUM_VALUE2 AI_LEVEL_NOVICE
248 #define SPECENUM_VALUE2NAME N_("Novice")
249 #define SPECENUM_VALUE3 AI_LEVEL_EASY
250 #define SPECENUM_VALUE3NAME N_("Easy")
251 #define SPECENUM_VALUE4 AI_LEVEL_NORMAL
252 #define SPECENUM_VALUE4NAME N_("Normal")
253 #define SPECENUM_VALUE5 AI_LEVEL_HARD
254 #define SPECENUM_VALUE5NAME N_("Hard")
255 #define SPECENUM_VALUE6 AI_LEVEL_CHEATING
256 #define SPECENUM_VALUE6NAME N_("Cheating")
258 #ifdef FREECIV_DEBUG
259 #define SPECENUM_VALUE7 AI_LEVEL_EXPERIMENTAL
260 #define SPECENUM_VALUE7NAME N_("Experimental")
261 #endif /* FREECIV_DEBUG */
263 #define SPECENUM_COUNT AI_LEVEL_COUNT
264 #include "specenum_gen.h"
266 #define AI_LEVEL_DEFAULT AI_LEVEL_NOVICE
268 /* pplayer->ai.barbarian_type and nations use this enum. */
269 #define SPECENUM_NAME barbarian_type
270 #define SPECENUM_VALUE0 NOT_A_BARBARIAN
271 #define SPECENUM_VALUE0NAME "None"
272 #define SPECENUM_VALUE1 LAND_BARBARIAN
273 #define SPECENUM_VALUE1NAME "Land"
274 #define SPECENUM_VALUE2 SEA_BARBARIAN
275 #define SPECENUM_VALUE2NAME "Sea"
276 #define SPECENUM_VALUE3 ANIMAL_BARBARIAN
277 #define SPECENUM_VALUE3NAME "Animal"
278 #define SPECENUM_VALUE4 LAND_AND_SEA_BARBARIAN
279 #define SPECENUM_VALUE4NAME "LandAndSea"
280 #include "specenum_gen.h"
283 * Citytile requirement types.
285 * Used in the network protocol
287 #define SPECENUM_NAME citytile_type
288 #define SPECENUM_VALUE0 CITYT_CENTER
289 #define SPECENUM_VALUE0NAME "Center"
290 #define SPECENUM_VALUE1 CITYT_CLAIMED
291 #define SPECENUM_VALUE1NAME "Claimed"
292 #define SPECENUM_COUNT CITYT_LAST
293 #include "specenum_gen.h"
296 * UnitState requirement property types.
298 * Used in the network protocol.
300 #define SPECENUM_NAME ustate_prop
301 #define SPECENUM_VALUE0 USP_TRANSPORTED
302 #define SPECENUM_VALUE0NAME "Transported"
303 #define SPECENUM_VALUE1 USP_LIVABLE_TILE
304 #define SPECENUM_VALUE1NAME "OnLivableTile"
305 #define SPECENUM_VALUE2 USP_DOMESTIC_TILE
306 #define SPECENUM_VALUE2NAME "OnDomesticTile"
307 #define SPECENUM_VALUE3 USP_TRANSPORTING
308 #define SPECENUM_VALUE3NAME "Transporting"
309 #define SPECENUM_VALUE4 USP_HAS_HOME_CITY
310 #define SPECENUM_VALUE4NAME "HasHomeCity"
311 #define SPECENUM_VALUE5 USP_NATIVE_TILE
312 #define SPECENUM_VALUE5NAME "OnNativeTile"
313 #define SPECENUM_COUNT USP_COUNT
314 #include "specenum_gen.h"
316 /* Changing these values will break map_init_topology. */
317 #define SPECENUM_NAME topo_flag
318 #define SPECENUM_BITWISE
319 #define SPECENUM_VALUE0 TF_WRAPX
320 #define SPECENUM_VALUE0NAME N_("WrapX")
321 #define SPECENUM_VALUE1 TF_WRAPY
322 #define SPECENUM_VALUE1NAME N_("WrapY")
323 #define SPECENUM_VALUE2 TF_ISO
324 #define SPECENUM_VALUE2NAME N_("ISO")
325 #define SPECENUM_VALUE3 TF_HEX
326 #define SPECENUM_VALUE3NAME N_("Hex")
327 #define TOPO_FLAG_BITS 4
328 #include "specenum_gen.h"
330 /* Used in the network protocol. */
331 #define SPECENUM_NAME impr_genus_id
332 #define SPECENUM_VALUE0 IG_GREAT_WONDER
333 #define SPECENUM_VALUE0NAME "GreatWonder"
334 #define SPECENUM_VALUE1 IG_SMALL_WONDER
335 #define SPECENUM_VALUE1NAME "SmallWonder"
336 #define SPECENUM_VALUE2 IG_IMPROVEMENT
337 #define SPECENUM_VALUE2NAME "Improvement"
338 #define SPECENUM_VALUE3 IG_SPECIAL
339 #define SPECENUM_VALUE3NAME "Special"
340 #define SPECENUM_COUNT IG_COUNT
341 #include "specenum_gen.h"
343 /* Sometimes we don't know (or don't care) if some requirements for effect
344 * are currently fulfilled or not. This enum tells lower level functions
345 * how to handle uncertain requirements.
347 enum req_problem_type {
348 RPT_POSSIBLE, /* We want to know if it is possible that effect is active */
349 RPT_CERTAIN /* We want to know if it is certain that effect is active */
352 #define REVERSED_RPT(x) \
353 (x == RPT_CERTAIN ? RPT_POSSIBLE : RPT_CERTAIN)
355 /* Originally in requirements.h, bumped up and revised to unify with
356 * city_production and worklists. Functions remain in requirements.c
357 * Used in the network protocol. */
358 typedef union {
359 struct advance *advance;
360 struct government *govern;
361 struct impr_type *building;
362 struct nation_type *nation;
363 struct nation_type *nationality;
364 struct specialist *specialist;
365 struct terrain *terrain;
366 struct unit_class *uclass;
367 struct unit_type *utype;
368 struct extra_type *extra;
369 struct achievement *achievement;
370 struct nation_group *nationgroup;
371 struct nation_style *style;
372 struct action *action;
373 struct goods_type *good;
375 enum ai_level ai_level;
376 enum citytile_type citytile;
377 int minsize;
378 int minculture;
379 int minyear;
380 int mincalfrag;
381 Output_type_id outputtype;
382 int terrainclass; /* enum terrain_class */
383 int terrainalter; /* enum terrain_alteration */
384 int unitclassflag; /* enum unit_class_flag_id */
385 int unitflag; /* enum unit_flag_id */
386 int terrainflag; /* enum terrain_flag_id */
387 int techflag; /* enum tech_flag_id */
388 int baseflag; /* enum base_flag_id */
389 int roadflag; /* enum road_flag_id */
390 int extraflag;
391 int diplrel; /* enum diplstate_type or
392 enum diplrel_other */
393 enum ustate_prop unit_state;
394 enum impr_genus_id impr_genus;
395 int minmoves;
396 int max_tile_units;
397 int minveteran;
398 int min_hit_points;
399 int age;
400 int min_techs;
402 enum topo_flag topo_property;
403 } universals_u;
405 /* The kind of universals_u (value_union_type was req_source_type).
406 * Used in the network protocol. */
407 #define SPECENUM_NAME universals_n
408 #define SPECENUM_VALUE0 VUT_NONE
409 #define SPECENUM_VALUE0NAME "None"
410 #define SPECENUM_VALUE1 VUT_ADVANCE
411 #define SPECENUM_VALUE1NAME "Tech"
412 #define SPECENUM_VALUE2 VUT_GOVERNMENT
413 #define SPECENUM_VALUE2NAME "Gov"
414 #define SPECENUM_VALUE3 VUT_IMPROVEMENT
415 #define SPECENUM_VALUE3NAME "Building"
416 #define SPECENUM_VALUE4 VUT_TERRAIN
417 #define SPECENUM_VALUE4NAME "Terrain"
418 #define SPECENUM_VALUE5 VUT_NATION
419 #define SPECENUM_VALUE5NAME "Nation"
420 #define SPECENUM_VALUE6 VUT_UTYPE
421 #define SPECENUM_VALUE6NAME "UnitType"
422 #define SPECENUM_VALUE7 VUT_UTFLAG
423 #define SPECENUM_VALUE7NAME "UnitFlag"
424 #define SPECENUM_VALUE8 VUT_UCLASS
425 #define SPECENUM_VALUE8NAME "UnitClass"
426 #define SPECENUM_VALUE9 VUT_UCFLAG
427 #define SPECENUM_VALUE9NAME "UnitClassFlag"
428 #define SPECENUM_VALUE10 VUT_OTYPE
429 #define SPECENUM_VALUE10NAME "OutputType"
430 #define SPECENUM_VALUE11 VUT_SPECIALIST
431 #define SPECENUM_VALUE11NAME "Specialist"
432 /* Minimum size: at city range means city size */
433 #define SPECENUM_VALUE12 VUT_MINSIZE
434 #define SPECENUM_VALUE12NAME "MinSize"
435 /* AI level of the player */
436 #define SPECENUM_VALUE13 VUT_AI_LEVEL
437 #define SPECENUM_VALUE13NAME "AI"
438 /* More generic terrain type currently "Land" or "Ocean" */
439 #define SPECENUM_VALUE14 VUT_TERRAINCLASS
440 #define SPECENUM_VALUE14NAME "TerrainClass"
441 #define SPECENUM_VALUE15 VUT_MINYEAR
442 #define SPECENUM_VALUE15NAME "MinYear"
443 /* Terrain alterations that are possible */
444 #define SPECENUM_VALUE16 VUT_TERRAINALTER
445 #define SPECENUM_VALUE16NAME "TerrainAlter"
446 /* Target tile is used by city. */
447 #define SPECENUM_VALUE17 VUT_CITYTILE
448 #define SPECENUM_VALUE17NAME "CityTile"
449 #define SPECENUM_VALUE18 VUT_GOOD
450 #define SPECENUM_VALUE18NAME "Good"
451 #define SPECENUM_VALUE19 VUT_TERRFLAG
452 #define SPECENUM_VALUE19NAME "TerrainFlag"
453 #define SPECENUM_VALUE20 VUT_NATIONALITY
454 #define SPECENUM_VALUE20NAME "Nationality"
455 #define SPECENUM_VALUE21 VUT_BASEFLAG
456 #define SPECENUM_VALUE21NAME "BaseFlag"
457 #define SPECENUM_VALUE22 VUT_ROADFLAG
458 #define SPECENUM_VALUE22NAME "RoadFlag"
459 #define SPECENUM_VALUE23 VUT_EXTRA
460 #define SPECENUM_VALUE23NAME "Extra"
461 #define SPECENUM_VALUE24 VUT_TECHFLAG
462 #define SPECENUM_VALUE24NAME "TechFlag"
463 #define SPECENUM_VALUE25 VUT_ACHIEVEMENT
464 #define SPECENUM_VALUE25NAME "Achievement"
465 #define SPECENUM_VALUE26 VUT_DIPLREL
466 #define SPECENUM_VALUE26NAME "DiplRel"
467 #define SPECENUM_VALUE27 VUT_MAXTILEUNITS
468 #define SPECENUM_VALUE27NAME "MaxUnitsOnTile"
469 #define SPECENUM_VALUE28 VUT_STYLE
470 #define SPECENUM_VALUE28NAME "Style"
471 #define SPECENUM_VALUE29 VUT_MINCULTURE
472 #define SPECENUM_VALUE29NAME "MinCulture"
473 #define SPECENUM_VALUE30 VUT_UNITSTATE
474 #define SPECENUM_VALUE30NAME "UnitState"
475 #define SPECENUM_VALUE31 VUT_MINMOVES
476 #define SPECENUM_VALUE31NAME "MinMoveFrags"
477 #define SPECENUM_VALUE32 VUT_MINVETERAN
478 #define SPECENUM_VALUE32NAME "MinVeteran"
479 #define SPECENUM_VALUE33 VUT_MINHP
480 #define SPECENUM_VALUE33NAME "MinHitPoints"
481 #define SPECENUM_VALUE34 VUT_AGE
482 #define SPECENUM_VALUE34NAME "Age"
483 #define SPECENUM_VALUE35 VUT_NATIONGROUP
484 #define SPECENUM_VALUE35NAME "NationGroup"
485 #define SPECENUM_VALUE36 VUT_TOPO
486 #define SPECENUM_VALUE36NAME "Topology"
487 #define SPECENUM_VALUE37 VUT_IMPR_GENUS
488 #define SPECENUM_VALUE37NAME "BuildingGenus"
489 #define SPECENUM_VALUE38 VUT_ACTION
490 #define SPECENUM_VALUE38NAME "Action"
491 #define SPECENUM_VALUE39 VUT_MINTECHS
492 #define SPECENUM_VALUE39NAME "MinTechs"
493 #define SPECENUM_VALUE40 VUT_EXTRAFLAG
494 #define SPECENUM_VALUE40NAME "ExtraFlag"
495 #define SPECENUM_VALUE41 VUT_MINCALFRAG
496 #define SPECENUM_VALUE41NAME "MinCalFrag"
497 /* Keep this last. */
498 #define SPECENUM_COUNT VUT_COUNT
499 #include "specenum_gen.h"
501 /* Used in the network protocol. */
502 struct universal {
503 universals_u value;
504 enum universals_n kind; /* formerly .type and .is_unit */
507 /* Used in the network protocol. */
508 BV_DEFINE(bv_extras, MAX_EXTRA_TYPES);
509 BV_DEFINE(bv_special, MAX_EXTRA_TYPES);
510 BV_DEFINE(bv_bases, MAX_BASE_TYPES);
511 BV_DEFINE(bv_roads, MAX_ROAD_TYPES);
512 BV_DEFINE(bv_startpos_nations, MAX_NUM_STARTPOS_NATIONS);
514 /* Used in the network protocol. */
515 #define SPECENUM_NAME gui_type
516 /* Used for options which do not belong to any gui. */
517 #define SPECENUM_VALUE0 GUI_STUB
518 #define SPECENUM_VALUE0NAME "stub"
519 /* GUI_GTK2 remains for now for keeping client options alive until
520 * user has migrated them to gtk3-client */
521 #define SPECENUM_VALUE1 GUI_GTK2
522 #define SPECENUM_VALUE1NAME "gtk2"
523 #define SPECENUM_VALUE2 GUI_GTK3
524 #define SPECENUM_VALUE2NAME "gtk3"
525 #define SPECENUM_VALUE3 GUI_GTK3_22
526 #define SPECENUM_VALUE3NAME "gtk3.22"
527 /* GUI_SDL remains for now for keeping client options alive until
528 * user has migrated them to sdl2-client */
529 #define SPECENUM_VALUE4 GUI_SDL
530 #define SPECENUM_VALUE4NAME "sdl"
531 #define SPECENUM_VALUE5 GUI_QT
532 #define SPECENUM_VALUE5NAME "qt"
533 #define SPECENUM_VALUE6 GUI_SDL2
534 #define SPECENUM_VALUE6NAME "sdl2"
535 #define SPECENUM_VALUE7 GUI_WEB
536 #define SPECENUM_VALUE7NAME "web"
537 #define SPECENUM_VALUE8 GUI_GTK3x
538 #define SPECENUM_VALUE8NAME "gtk3x"
539 #include "specenum_gen.h"
541 /* Used in the network protocol. */
542 #define SPECENUM_NAME airlifting_style
543 #define SPECENUM_BITWISE
544 /* Like classical Freeciv. One unit per turn. */
545 #define SPECENUM_ZERO AIRLIFTING_CLASSICAL
546 /* Allow airlifting from allied cities. */
547 #define SPECENUM_VALUE0 AIRLIFTING_ALLIED_SRC
548 /* Allow airlifting to allied cities. */
549 #define SPECENUM_VALUE1 AIRLIFTING_ALLIED_DEST
550 /* Unlimited units to airlift from the source (but always needs an Airport
551 * or equivalent). */
552 #define SPECENUM_VALUE2 AIRLIFTING_UNLIMITED_SRC
553 /* Unlimited units to airlift to the destination (doesn't require any
554 * Airport or equivalent). */
555 #define SPECENUM_VALUE3 AIRLIFTING_UNLIMITED_DEST
556 #include "specenum_gen.h"
558 /* Used in the network protocol. */
559 #define SPECENUM_NAME persistent_ready
560 #define SPECENUM_VALUE0 PERSISTENTR_DISABLED
561 #define SPECENUM_VALUE0NAME "Disabled"
562 #define SPECENUM_VALUE1 PERSISTENTR_CONNECTED
563 #define SPECENUM_VALUE1NAME "Connected"
564 #include "specenum_gen.h"
566 #define SPECENUM_NAME reveal_map
567 #define SPECENUM_BITWISE
568 /* Reveal only the area around the first units at the beginning. */
569 #define SPECENUM_ZERO REVEAL_MAP_NONE
570 /* Reveal the (fogged) map at the beginning of the game. */
571 #define SPECENUM_VALUE0 REVEAL_MAP_START
572 /* Reveal (and unfog) the map for dead players. */
573 #define SPECENUM_VALUE1 REVEAL_MAP_DEAD
574 #include "specenum_gen.h"
576 /* Used in the network protocol. */
577 #define SPECENUM_NAME gameloss_style
578 #define SPECENUM_BITWISE
579 /* Like classical Freeciv. No special effects. */
580 #define SPECENUM_ZERO GAMELOSS_STYLE_CLASSICAL
581 /* Remaining cities are taken by barbarians. */
582 #define SPECENUM_VALUE0 GAMELOSS_STYLE_BARB
583 #define SPECENUM_VALUE0NAME "Barbarians"
584 /* Try civil war. */
585 #define SPECENUM_VALUE1 GAMELOSS_STYLE_CWAR
586 #define SPECENUM_VALUE1NAME "CivilWar"
587 /* Do some looting */
588 #define SPECENUM_VALUE2 GAMELOSS_STYLE_LOOT
589 #define SPECENUM_VALUE2NAME "Loot"
590 #include "specenum_gen.h"
592 /* Used in the network protocol. */
593 #define SPECENUM_NAME tech_upkeep_style
594 /* No upkeep */
595 #define SPECENUM_VALUE0 TECH_UPKEEP_NONE
596 #define SPECENUM_VALUE0NAME "None"
597 /* Normal tech upkeep */
598 #define SPECENUM_VALUE1 TECH_UPKEEP_BASIC
599 #define SPECENUM_VALUE1NAME "Basic"
600 /* Tech upkeep multiplied by number of cities */
601 #define SPECENUM_VALUE2 TECH_UPKEEP_PER_CITY
602 #define SPECENUM_VALUE2NAME "Cities"
603 #include "specenum_gen.h"
605 /* Used in the network protocol. */
606 /* Numerical values used in savegames */
607 #define SPECENUM_NAME phase_mode_type
608 #define SPECENUM_VALUE0 PMT_CONCURRENT
609 #define SPECENUM_VALUE0NAME "Concurrent"
610 #define SPECENUM_VALUE1 PMT_PLAYERS_ALTERNATE
611 #define SPECENUM_VALUE1NAME "Players Alternate"
612 #define SPECENUM_VALUE2 PMT_TEAMS_ALTERNATE
613 #define SPECENUM_VALUE2NAME "Teams Alternate"
614 #include "specenum_gen.h"
616 /* Phase mode change has changed meaning of the phase numbers */
617 #define PHASE_INVALIDATED -1
618 /* Phase was never known */
619 #define PHASE_UNKNOWN -2
621 /* Used in the network protocol. */
622 enum borders_mode {
623 BORDERS_DISABLED = 0,
624 BORDERS_ENABLED,
625 BORDERS_SEE_INSIDE,
626 BORDERS_EXPAND
629 enum trait_dist_mode {
630 TDM_FIXED = 0,
631 TDM_EVEN
634 /* Used in the network protocol. */
635 enum diplomacy_mode {
636 DIPLO_FOR_ALL,
637 DIPLO_FOR_HUMANS,
638 DIPLO_FOR_AIS,
639 DIPLO_NO_AIS,
640 DIPLO_NO_MIXED,
641 DIPLO_FOR_TEAMS,
642 DIPLO_DISABLED,
645 /* Used in the network protocol. */
646 #define SPECENUM_NAME extra_category
647 #define SPECENUM_VALUE0 ECAT_INFRA
648 #define SPECENUM_VALUE0NAME "Infra"
649 #define SPECENUM_VALUE1 ECAT_NATURAL
650 #define SPECENUM_VALUE1NAME "Natural"
651 #define SPECENUM_VALUE2 ECAT_NUISANCE
652 #define SPECENUM_VALUE2NAME "Nuisance"
653 #define SPECENUM_VALUE3 ECAT_BONUS
654 #define SPECENUM_VALUE3NAME "Bonus"
655 #define SPECENUM_VALUE4 ECAT_RESOURCE
656 #define SPECENUM_VALUE4NAME "Resource"
657 #define SPECENUM_COUNT ECAT_COUNT
658 #include "specenum_gen.h"
659 #define ECAT_NONE ECAT_COUNT
660 #define ECAT_LAST ECAT_COUNT
662 /* Used in the network protocol. */
663 #define SPECENUM_NAME extra_cause
664 #define SPECENUM_VALUE0 EC_IRRIGATION
665 #define SPECENUM_VALUE0NAME "Irrigation"
666 #define SPECENUM_VALUE1 EC_MINE
667 #define SPECENUM_VALUE1NAME "Mine"
668 #define SPECENUM_VALUE2 EC_ROAD
669 #define SPECENUM_VALUE2NAME "Road"
670 #define SPECENUM_VALUE3 EC_BASE
671 #define SPECENUM_VALUE3NAME "Base"
672 #define SPECENUM_VALUE4 EC_POLLUTION
673 #define SPECENUM_VALUE4NAME "Pollution"
674 #define SPECENUM_VALUE5 EC_FALLOUT
675 #define SPECENUM_VALUE5NAME "Fallout"
676 #define SPECENUM_VALUE6 EC_HUT
677 #define SPECENUM_VALUE6NAME "Hut"
678 #define SPECENUM_VALUE7 EC_APPEARANCE
679 #define SPECENUM_VALUE7NAME "Appear"
680 #define SPECENUM_VALUE8 EC_RESOURCE
681 #define SPECENUM_VALUE8NAME "Resource"
682 #define SPECENUM_COUNT EC_COUNT
683 #include "specenum_gen.h"
684 #define EC_NONE EC_COUNT
685 #define EC_SPECIAL (EC_NONE + 1)
686 #define EC_DEFENSIVE (EC_NONE + 2)
687 #define EC_NATURAL_DEFENSIVE (EC_NONE + 3)
688 #define EC_LAST (EC_NONE + 4)
690 /* packets.def and struct extra_type reserve 16 bits (0-15) for these. */
691 FC_STATIC_ASSERT(EC_COUNT < 16, extra_causes_over_limit);
693 /* Used in the network protocol. */
694 #define SPECENUM_NAME extra_rmcause
695 #define SPECENUM_VALUE0 ERM_PILLAGE
696 #define SPECENUM_VALUE0NAME "Pillage"
697 #define SPECENUM_VALUE1 ERM_CLEANPOLLUTION
698 #define SPECENUM_VALUE1NAME "CleanPollution"
699 #define SPECENUM_VALUE2 ERM_CLEANFALLOUT
700 #define SPECENUM_VALUE2NAME "CleanFallout"
701 #define SPECENUM_VALUE3 ERM_DISAPPEARANCE
702 #define SPECENUM_VALUE3NAME "Disappear"
703 #define SPECENUM_COUNT ERM_COUNT
704 #include "specenum_gen.h"
705 #define ERM_NONE ERM_COUNT
707 /* packets.def and struct extra_type reserve 8 bits (0-7) for these. */
708 FC_STATIC_ASSERT(ERM_COUNT < 8, extra_rmcauses_over_limit);
710 #define SPECENUM_NAME extra_unit_seen_type
711 #define SPECENUM_VALUE0 EUS_NORMAL
712 #define SPECENUM_VALUE0NAME "Normal"
713 #define SPECENUM_VALUE1 EUS_HIDDEN
714 #define SPECENUM_VALUE1NAME "Hidden"
715 #include "specenum_gen.h"
717 /* Used in the network protocol. */
718 #define SPECENUM_NAME achievement_type
719 #define SPECENUM_VALUE0 ACHIEVEMENT_SPACESHIP
720 #define SPECENUM_VALUE0NAME "Spaceship"
721 #define SPECENUM_VALUE1 ACHIEVEMENT_MAP
722 #define SPECENUM_VALUE1NAME "Map_Known"
723 #define SPECENUM_VALUE2 ACHIEVEMENT_MULTICULTURAL
724 #define SPECENUM_VALUE2NAME "Multicultural"
725 #define SPECENUM_VALUE3 ACHIEVEMENT_CULTURED_CITY
726 #define SPECENUM_VALUE3NAME "Cultured_City"
727 #define SPECENUM_VALUE4 ACHIEVEMENT_CULTURED_NATION
728 #define SPECENUM_VALUE4NAME "Cultured_Nation"
729 #define SPECENUM_VALUE5 ACHIEVEMENT_LUCKY
730 #define SPECENUM_VALUE5NAME "Lucky"
731 #define SPECENUM_VALUE6 ACHIEVEMENT_HUTS
732 #define SPECENUM_VALUE6NAME "Huts"
733 #define SPECENUM_VALUE7 ACHIEVEMENT_METROPOLIS
734 #define SPECENUM_VALUE7NAME "Metropolis"
735 #define SPECENUM_VALUE8 ACHIEVEMENT_LITERATE
736 #define SPECENUM_VALUE8NAME "Literate"
737 #define SPECENUM_VALUE9 ACHIEVEMENT_LAND_AHOY
738 #define SPECENUM_VALUE9NAME "Land_Ahoy"
739 #define SPECENUM_COUNT ACHIEVEMENT_COUNT
740 #include "specenum_gen.h"
742 /* Used in the network protocol. */
743 #define SPECENUM_NAME mood_type
744 #define SPECENUM_VALUE0 MOOD_PEACEFUL
745 #define SPECENUM_VALUE0NAME "Peaceful"
746 #define SPECENUM_VALUE1 MOOD_COMBAT
747 #define SPECENUM_VALUE1NAME "Combat"
748 #define SPECENUM_COUNT MOOD_COUNT
749 #include "specenum_gen.h"
751 /* Used in the network protocol. */
752 #define SPECENUM_NAME action_decision
753 /* Doesn't need the player to decide what action to take. */
754 #define SPECENUM_VALUE0 ACT_DEC_NOTHING
755 #define SPECENUM_VALUE0NAME N_("nothing")
756 /* Wants a decision because of something done to the actor. */
757 #define SPECENUM_VALUE1 ACT_DEC_PASSIVE
758 #define SPECENUM_VALUE1NAME N_("passive")
759 /* Wants a decision because of something the actor did. */
760 #define SPECENUM_VALUE2 ACT_DEC_ACTIVE
761 #define SPECENUM_VALUE2NAME N_("active")
762 #define SPECENUM_COUNT ACT_DEC_COUNT
763 #include "specenum_gen.h"
766 * Action probability
768 * An action probability is the probability that an action will be
769 * successful under the given circumstances. It is an interval that
770 * includes the end points. An end point goes from 0% to 100%.
771 * Alternatively it can signal a special case.
773 * End point values from 0 up to and including 200 should be understood as
774 * the chance of success measured in half percentage points. In other words:
775 * The value 3 indicates that the chance is 1.5%. The value 10 indicates
776 * that the chance is 5%. The probability of a minimum may be rounded down
777 * to the nearest half percentage point. The probability of a maximum may
778 * be rounded up to the nearest half percentage point.
780 * Values with a higher minimum than maximum are special case values. All
781 * special cases should be declared and documented below. An undocumented
782 * value in this range should be considered a bug. If a special value for
783 * internal use is needed please avoid the range from and including 0 up
784 * to and including 255.
786 * [0, 0] ACTPROB_IMPOSSIBLE is another way of saying that the
787 * probability is 0%. It isn't really a special value since it
788 * is in range.
790 * [200, 200] ACTPROB_CERTAIN is another way of saying that the probability
791 * is 100%. It isn't really a special value since it is in range.
793 * [253, 0] ACTPROB_NA indicates that no probability should exist.
795 * [254, 0] ACTPROB_NOT_IMPLEMENTED indicates that support for finding
796 * this probability currently is missing.
798 * [0, 200] ACTPROB_NOT_KNOWN indicates that the player don't know enough
799 * to find out. It is caused by the probability depending on a
800 * rule that depends on game state the player don't have access
801 * to. It may be possible for the player to later gain access to
802 * this game state. It isn't really a special value since it is
803 * in range.
805 struct act_prob {
806 int min;
807 int max;
810 enum test_result {
811 TR_SUCCESS,
812 TR_OTHER_FAILURE,
813 TR_ALREADY_SOLD
816 /* Road type compatibility with old specials based roads.
817 * Used in the network protocol. */
818 enum road_compat { ROCO_ROAD, ROCO_RAILROAD, ROCO_RIVER, ROCO_NONE };
821 * Maximum number of trade routes a city can have in any situation.
822 * Changing this changes network protocol.
824 #define MAX_TRADE_ROUTES 5
826 /* Used in the network protocol. */
827 #define SPECENUM_NAME goods_selection_method
828 #define SPECENUM_VALUE0 GSM_LEAVING
829 #define SPECENUM_VALUE0NAME "Leaving"
830 #define SPECENUM_VALUE1 GSM_ARRIVAL
831 #define SPECENUM_VALUE1NAME "Arrival"
832 #include "specenum_gen.h"
834 enum victory_condition_type
836 VC_SPACERACE = 0,
837 VC_ALLIED,
838 VC_CULTURE
841 enum environment_upset_type
843 EUT_GLOBAL_WARMING = 0,
844 EUT_NUCLEAR_WINTER
847 enum revolen_type {
848 REVOLEN_FIXED = 0,
849 REVOLEN_RANDOM,
850 REVOLEN_QUICKENING,
851 REVOLEN_RANDQUICK
854 enum happyborders_type {
855 HB_DISABLED = 0,
856 HB_NATIONAL,
857 HB_ALLIANCE
860 /* Used in network protocol. */
861 enum spaceship_place_type {
862 SSHIP_PLACE_STRUCTURAL,
863 SSHIP_PLACE_FUEL,
864 SSHIP_PLACE_PROPULSION,
865 SSHIP_PLACE_HABITATION,
866 SSHIP_PLACE_LIFE_SUPPORT,
867 SSHIP_PLACE_SOLAR_PANELS
870 /* Used in the network protocol. */
871 #define SPECENUM_NAME tech_cost_style
872 #define SPECENUM_VALUE0 TECH_COST_CIV1CIV2
873 #define SPECENUM_VALUE0NAME "Civ I|II"
874 #define SPECENUM_VALUE1 TECH_COST_CLASSIC
875 #define SPECENUM_VALUE1NAME "Classic"
876 #define SPECENUM_VALUE2 TECH_COST_CLASSIC_PRESET
877 #define SPECENUM_VALUE2NAME "Classic+"
878 #define SPECENUM_VALUE3 TECH_COST_EXPERIMENTAL
879 #define SPECENUM_VALUE3NAME "Experimental"
880 #define SPECENUM_VALUE4 TECH_COST_EXPERIMENTAL_PRESET
881 #define SPECENUM_VALUE4NAME "Experimental+"
882 #include "specenum_gen.h"
884 /* Used in the network protocol. */
885 #define SPECENUM_NAME tech_leakage_style
886 #define SPECENUM_VALUE0 TECH_LEAKAGE_NONE
887 #define SPECENUM_VALUE0NAME "None"
888 #define SPECENUM_VALUE1 TECH_LEAKAGE_EMBASSIES
889 #define SPECENUM_VALUE1NAME "Embassies"
890 #define SPECENUM_VALUE2 TECH_LEAKAGE_PLAYERS
891 #define SPECENUM_VALUE2NAME "All Players"
892 #define SPECENUM_VALUE3 TECH_LEAKAGE_NO_BARBS
893 #define SPECENUM_VALUE3NAME "Normal Players"
894 #include "specenum_gen.h"
896 /* Used in the network protocol. */
897 #define SPECENUM_NAME gold_upkeep_style
898 #define SPECENUM_VALUE0 GOLD_UPKEEP_CITY
899 #define SPECENUM_VALUE0NAME "City"
900 #define SPECENUM_VALUE1 GOLD_UPKEEP_MIXED
901 #define SPECENUM_VALUE1NAME "Mixed"
902 #define SPECENUM_VALUE2 GOLD_UPKEEP_NATION
903 #define SPECENUM_VALUE2NAME "Nation"
904 #include "specenum_gen.h"
906 typedef float adv_want;
907 #define ADV_WANT_PRINTF "%f"
909 #ifdef __cplusplus
911 #endif /* __cplusplus */
913 #endif /* FC__FC_TYPES_H */