Prevented building advisor from randomly building, and thus potentially just moving...
[freeciv.git] / common / map_types.h
blobf38c358fbd41a44ca7589bb9ccf1a81d2a95e77d
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 /****************************************************************
21 Miscellaneous terrain information
22 *****************************************************************/
23 #define terrain_misc packet_ruleset_terrain_control
25 /* Some types used below. */
26 struct nation_hash;
27 struct nation_type;
28 struct packet_edit_startpos_full;
29 struct startpos;
30 struct startpos_hash;
32 enum mapsize_type {
33 MAPSIZE_FULLSIZE = 0, /* Using the number of tiles / 1000. */
34 MAPSIZE_PLAYER, /* Define the number of (land) tiles per player;
35 * the setting 'landmass' and the number of players
36 * are used to calculate the map size. */
37 MAPSIZE_XYSIZE /* 'xsize' and 'ysize' are defined. */
40 enum map_generator {
41 MAPGEN_SCENARIO = 0,
42 MAPGEN_RANDOM,
43 MAPGEN_FRACTAL,
44 MAPGEN_ISLAND,
45 MAPGEN_FAIR
48 enum map_startpos {
49 MAPSTARTPOS_DEFAULT = 0, /* Generator's choice. */
50 MAPSTARTPOS_SINGLE, /* One player per continent. */
51 MAPSTARTPOS_2or3, /* Two on three players per continent. */
52 MAPSTARTPOS_ALL, /* All players on a single continent. */
53 MAPSTARTPOS_VARIABLE, /* Depending on size of continents. */
56 #define SPECENUM_NAME team_placement
57 #define SPECENUM_VALUE0 TEAM_PLACEMENT_DISABLED
58 #define SPECENUM_VALUE1 TEAM_PLACEMENT_CLOSEST
59 #define SPECENUM_VALUE2 TEAM_PLACEMENT_CONTINENT
60 #define SPECENUM_VALUE3 TEAM_PLACEMENT_HORIZONTAL
61 #define SPECENUM_VALUE4 TEAM_PLACEMENT_VERTICAL
62 #include "specenum_gen.h"
64 struct civ_map {
65 int topology_id;
66 enum direction8 valid_dirs[8], cardinal_dirs[8];
67 int num_valid_dirs, num_cardinal_dirs;
68 struct iter_index *iterate_outwards_indices;
69 int num_iterate_outwards_indices;
70 int xsize, ysize; /* native dimensions */
71 int num_continents;
72 int num_oceans; /* not updated at the client */
73 struct tile *tiles;
74 struct startpos_hash *startpos_table;
76 union {
77 struct {
78 enum mapsize_type mapsize; /* how the map size is defined */
79 int size; /* used to calculate [xy]size */
80 int tilesperplayer; /* tiles per player; used to calculate size */
81 int seed_setting;
82 int seed;
83 int riches;
84 int huts;
85 int huts_absolute; /* For compatibility conversion from pre-2.6 savegames */
86 int animals;
87 int landpercent;
88 enum map_generator generator;
89 enum map_startpos startpos;
90 bool tinyisles;
91 bool separatepoles;
92 int flatpoles;
93 bool single_pole;
94 bool alltemperate;
95 int temperature;
96 int wetness;
97 int steepness;
98 bool ocean_resources; /* Resources in the middle of the ocean */
99 bool have_huts;
100 bool have_resources;
101 enum team_placement team_placement;
102 } server;
104 /* Add client side when needed */
108 #ifdef __cplusplus
110 #endif /* __cplusplus */
112 #endif /* FC__MAP_H */