Stop sharing requirement_unit_state_ereq().
[freeciv.git] / common / map_types.h
blob994a123d7cb8d9cb413656fdd2787d386e67ae61
1 /***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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 ***********************************************************************/
13 #ifndef FC__MAP_TYPES_H
14 #define FC__MAP_TYPES_H
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */
20 /* common */
21 #include "fc_types.h"
23 /****************************************************************
24 Miscellaneous terrain information
25 *****************************************************************/
26 #define terrain_misc packet_ruleset_terrain_control
28 /* Some types used below. */
29 struct nation_hash;
30 struct nation_type;
31 struct packet_edit_startpos_full;
32 struct startpos;
33 struct startpos_hash;
35 enum mapsize_type {
36 MAPSIZE_FULLSIZE = 0, /* Using the number of tiles / 1000. */
37 MAPSIZE_PLAYER, /* Define the number of (land) tiles per player;
38 * the setting 'landmass' and the number of players
39 * are used to calculate the map size. */
40 MAPSIZE_XYSIZE /* 'xsize' and 'ysize' are defined. */
43 enum map_generator {
44 MAPGEN_SCENARIO = 0,
45 MAPGEN_RANDOM,
46 MAPGEN_FRACTAL,
47 MAPGEN_ISLAND,
48 MAPGEN_FAIR,
49 MAPGEN_FRACTURE
52 enum map_startpos {
53 MAPSTARTPOS_DEFAULT = 0, /* Generator's choice. */
54 MAPSTARTPOS_SINGLE, /* One player per continent. */
55 MAPSTARTPOS_2or3, /* Two on three players per continent. */
56 MAPSTARTPOS_ALL, /* All players on a single continent. */
57 MAPSTARTPOS_VARIABLE, /* Depending on size of continents. */
60 #define SPECENUM_NAME team_placement
61 #define SPECENUM_VALUE0 TEAM_PLACEMENT_DISABLED
62 #define SPECENUM_VALUE1 TEAM_PLACEMENT_CLOSEST
63 #define SPECENUM_VALUE2 TEAM_PLACEMENT_CONTINENT
64 #define SPECENUM_VALUE3 TEAM_PLACEMENT_HORIZONTAL
65 #define SPECENUM_VALUE4 TEAM_PLACEMENT_VERTICAL
66 #include "specenum_gen.h"
68 struct civ_map {
69 int topology_id;
70 enum direction8 valid_dirs[8], cardinal_dirs[8];
71 int num_valid_dirs, num_cardinal_dirs;
72 struct iter_index *iterate_outwards_indices;
73 int num_iterate_outwards_indices;
74 int xsize, ysize; /* native dimensions */
75 int num_continents;
76 int num_oceans; /* not updated at the client */
77 struct tile *tiles;
78 struct startpos_hash *startpos_table;
80 union {
81 struct {
82 enum mapsize_type mapsize; /* how the map size is defined */
83 int size; /* used to calculate [xy]size */
84 int tilesperplayer; /* tiles per player; used to calculate size */
85 int seed_setting;
86 int seed;
87 int riches;
88 int huts;
89 int huts_absolute; /* For compatibility conversion from pre-2.6 savegames */
90 int animals;
91 int landpercent;
92 enum map_generator generator;
93 enum map_startpos startpos;
94 bool tinyisles;
95 bool separatepoles;
96 int flatpoles;
97 bool single_pole;
98 bool alltemperate;
99 int temperature;
100 int wetness;
101 int steepness;
102 bool ocean_resources; /* Resources in the middle of the ocean */
103 bool have_huts;
104 bool have_resources;
105 enum team_placement team_placement;
106 } server;
108 /* Add client side when needed */
112 #ifdef __cplusplus
114 #endif /* __cplusplus */
116 #endif /* FC__MAP_H */