Freeciv21
Develop your civilization from humble roots to a global empire
map_types.h
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3 \_ \ / __/ contributors. This file is part of Freeciv21.
4  _\ \ / /__ Freeciv21 is free software: you can redistribute it
5  \___ \____/ __/ and/or modify it under the terms of the GNU General
6  \_ _/ Public License as published by the Free Software
7  | @ @ \_ Foundation, either version 3 of the License,
8  | or (at your option) any later version.
9  _/ /\ You should have received a copy of the GNU
10  /o) (o/\ \_ General Public License along with Freeciv21.
11  \_____/ / If not, see https://www.gnu.org/licenses/.
12  \____/ ********************************************************/
13 #pragma once
14 
15 #include <QHash>
16 
17 // common
18 #include "fc_types.h"
19 
20 /****************************************************************
21  Miscellaneous terrain information
22 *****************************************************************/
23 #define terrain_misc packet_ruleset_terrain_control
24 
25 struct nation_type;
26 struct packet_edit_startpos_full;
27 
28 struct startpos {
29  struct tile *location;
30  bool exclude;
31  QSet<const struct nation_type *> *nations;
32 };
33 
35  MAPSIZE_FULLSIZE = 0, /* Using the number of tiles / 1000. */
36  MAPSIZE_PLAYER, /* Define the number of (land) tiles per player;
37  * the setting 'landmass' and the number of players
38  * are used to calculate the map size. */
39  MAPSIZE_XYSIZE // 'xsize' and 'ysize' are defined.
40 };
41 
49 };
50 
52  MAPSTARTPOS_DEFAULT = 0, // Generator's choice.
53  MAPSTARTPOS_SINGLE, // One player per continent.
54  MAPSTARTPOS_2or3, // Two on three players per continent.
55  MAPSTARTPOS_ALL, // All players on a single continent.
56  MAPSTARTPOS_VARIABLE, // Depending on size of continents.
57 };
58 
59 #define SPECENUM_NAME team_placement
60 #define SPECENUM_VALUE0 TEAM_PLACEMENT_DISABLED
61 #define SPECENUM_VALUE1 TEAM_PLACEMENT_CLOSEST
62 #define SPECENUM_VALUE2 TEAM_PLACEMENT_CONTINENT
63 #define SPECENUM_VALUE3 TEAM_PLACEMENT_HORIZONTAL
64 #define SPECENUM_VALUE4 TEAM_PLACEMENT_VERTICAL
65 #include "specenum_gen.h"
66 
67 struct civ_map {
69  enum direction8 valid_dirs[8], cardinal_dirs[8];
73  int xsize, ysize; // native dimensions
75  int num_oceans; // not updated at the client
76  struct tile *tiles;
77  QHash<struct tile *, struct startpos *> *startpos_table;
78 
79  union {
80  struct {
81  enum mapsize_type mapsize; // how the map size is defined
82  int size; // used to calculate [xy]size
83  int tilesperplayer; // tiles per player; used to calculate size
85  int seed;
86  int riches;
87  int huts;
88  int huts_absolute; /* For compatibility conversion from pre-2.6
89  savegames */
90  int animals;
94  bool tinyisles;
96  int flatpoles;
100  int wetness;
102  bool ocean_resources; // Resources in the middle of the ocean
103  bool have_huts;
107 
108  // Add client side when needed
109  };
110 };
mapsize_type
Definition: map_types.h:34
@ MAPSIZE_FULLSIZE
Definition: map_types.h:35
@ MAPSIZE_PLAYER
Definition: map_types.h:36
@ MAPSIZE_XYSIZE
Definition: map_types.h:39
map_generator
Definition: map_types.h:42
@ MAPGEN_SCENARIO
Definition: map_types.h:43
@ MAPGEN_FRACTURE
Definition: map_types.h:48
@ MAPGEN_ISLAND
Definition: map_types.h:46
@ MAPGEN_FAIR
Definition: map_types.h:47
@ MAPGEN_FRACTAL
Definition: map_types.h:45
@ MAPGEN_RANDOM
Definition: map_types.h:44
map_startpos
Definition: map_types.h:51
@ MAPSTARTPOS_VARIABLE
Definition: map_types.h:56
@ MAPSTARTPOS_2or3
Definition: map_types.h:54
@ MAPSTARTPOS_ALL
Definition: map_types.h:55
@ MAPSTARTPOS_DEFAULT
Definition: map_types.h:52
@ MAPSTARTPOS_SINGLE
Definition: map_types.h:53
struct tile * tiles
Definition: map_types.h:76
int animals
Definition: map_types.h:90
int xsize
Definition: map_types.h:73
bool tinyisles
Definition: map_types.h:94
int ysize
Definition: map_types.h:73
int num_continents
Definition: map_types.h:74
enum direction8 valid_dirs[8]
Definition: map_types.h:69
int riches
Definition: map_types.h:86
bool alltemperate
Definition: map_types.h:98
int num_iterate_outwards_indices
Definition: map_types.h:72
int num_cardinal_dirs
Definition: map_types.h:70
enum mapsize_type mapsize
Definition: map_types.h:81
int num_valid_dirs
Definition: map_types.h:70
enum map_startpos startpos
Definition: map_types.h:93
int num_oceans
Definition: map_types.h:75
int seed_setting
Definition: map_types.h:84
bool have_resources
Definition: map_types.h:104
int steepness
Definition: map_types.h:101
int wetness
Definition: map_types.h:100
int size
Definition: map_types.h:82
int tilesperplayer
Definition: map_types.h:83
struct iter_index * iterate_outwards_indices
Definition: map_types.h:71
int landpercent
Definition: map_types.h:91
enum team_placement team_placement
Definition: map_types.h:105
int topology_id
Definition: map_types.h:68
int seed
Definition: map_types.h:85
enum direction8 cardinal_dirs[8]
Definition: map_types.h:69
int flatpoles
Definition: map_types.h:96
int huts
Definition: map_types.h:87
QHash< struct tile *, struct startpos * > * startpos_table
Definition: map_types.h:77
bool have_huts
Definition: map_types.h:103
bool single_pole
Definition: map_types.h:97
struct civ_map::@39::@41 server
enum map_generator generator
Definition: map_types.h:92
bool ocean_resources
Definition: map_types.h:102
bool separatepoles
Definition: map_types.h:95
int temperature
Definition: map_types.h:99
int huts_absolute
Definition: map_types.h:88
bool exclude
Definition: map_types.h:30
QSet< const struct nation_type * > * nations
Definition: map_types.h:31
struct tile * location
Definition: map_types.h:29
Definition: tile.h:42