Freeciv-3.3
Loading...
Searching...
No Matches
map_types.h
Go to the documentation of this file.
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.
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#ifndef FC__MAP_TYPES_H
14#define FC__MAP_TYPES_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/* utility */
21#include "randseed.h"
22
23/* common */
24#include "fc_types.h"
25
26/*****************************************************************
27 Miscellaneous terrain information
28*****************************************************************/
29#define terrain_misc packet_ruleset_terrain_control
30
31/* Some types used below. */
32struct nation_hash;
33struct nation_type;
35struct startpos;
36struct startpos_hash;
37
39 MAPSIZE_FULLSIZE = 0, /* Using the number of tiles / 1000. */
40 MAPSIZE_PLAYER, /* Define the number of (land) tiles per player;
41 * the setting 'landmass' and the number of players
42 * are used to calculate the map size. */
43 MAPSIZE_XYSIZE /* 'xsize' and 'ysize' are defined. */
44};
45
54
56 MAPSTARTPOS_DEFAULT = 0, /* Generator's choice. */
57 MAPSTARTPOS_SINGLE, /* One player per continent. */
58 MAPSTARTPOS_2or3, /* Two on three players per continent. */
59 MAPSTARTPOS_ALL, /* All players on a single continent. */
60 MAPSTARTPOS_VARIABLE, /* Depending on size of continents. */
61};
62
63#define SPECENUM_NAME team_placement
64#define SPECENUM_VALUE0 TEAM_PLACEMENT_DISABLED
65#define SPECENUM_VALUE1 TEAM_PLACEMENT_CLOSEST
66#define SPECENUM_VALUE2 TEAM_PLACEMENT_CONTINENT
67#define SPECENUM_VALUE3 TEAM_PLACEMENT_HORIZONTAL
68#define SPECENUM_VALUE4 TEAM_PLACEMENT_VERTICAL
69#include "specenum_gen.h"
70
71struct civ_map {
79 int xsize, ysize; /* Native dimensions */
83 int num_oceans; /* Not updated at the client */
84 struct tile *tiles;
86
87 union {
88 struct {
89 enum mapsize_type mapsize; /* How the map size is defined */
90 int size; /* Used to calculate [xy]size */
91 int tilesperplayer; /* Tiles per player; used to calculate size */
94 int riches;
95 int huts;
96 int huts_absolute; /* For compatibility conversion from pre-2.6 savegames */
107 bool ocean_resources; /* Resources in the middle of the ocean */
110 enum team_placement team_placement;
112
113 /* Add client side when needed */
114 };
115};
116
117#ifdef __cplusplus
118}
119#endif /* __cplusplus */
120
121#endif /* FC__MAP_H */
char * incite_cost
Definition comments.c:74
mapsize_type
Definition map_types.h:38
@ MAPSIZE_FULLSIZE
Definition map_types.h:39
@ MAPSIZE_PLAYER
Definition map_types.h:40
@ MAPSIZE_XYSIZE
Definition map_types.h:43
map_generator
Definition map_types.h:46
@ MAPGEN_SCENARIO
Definition map_types.h:47
@ MAPGEN_FRACTURE
Definition map_types.h:52
@ MAPGEN_ISLAND
Definition map_types.h:50
@ MAPGEN_FAIR
Definition map_types.h:51
@ MAPGEN_FRACTAL
Definition map_types.h:49
@ MAPGEN_RANDOM
Definition map_types.h:48
map_startpos
Definition map_types.h:55
@ MAPSTARTPOS_VARIABLE
Definition map_types.h:60
@ MAPSTARTPOS_2or3
Definition map_types.h:58
@ MAPSTARTPOS_ALL
Definition map_types.h:59
@ MAPSTARTPOS_DEFAULT
Definition map_types.h:56
@ MAPSTARTPOS_SINGLE
Definition map_types.h:57
unsigned int randseed
Definition randseed.h:23
struct startpos_hash * startpos_table
Definition map_types.h:85
struct tile * tiles
Definition map_types.h:84
int animals
Definition map_types.h:97
int xsize
Definition map_types.h:79
randseed seed
Definition map_types.h:93
bool tinyisles
Definition map_types.h:101
int ysize
Definition map_types.h:79
int num_continents
Definition map_types.h:82
enum direction8 valid_dirs[8]
Definition map_types.h:75
int riches
Definition map_types.h:94
int north_latitude
Definition map_types.h:80
int num_iterate_outwards_indices
Definition map_types.h:78
int num_cardinal_dirs
Definition map_types.h:76
enum mapsize_type mapsize
Definition map_types.h:89
int num_valid_dirs
Definition map_types.h:76
int south_latitude
Definition map_types.h:81
enum map_startpos startpos
Definition map_types.h:100
int num_oceans
Definition map_types.h:83
bool have_resources
Definition map_types.h:109
int steepness
Definition map_types.h:106
int wetness
Definition map_types.h:105
int size
Definition map_types.h:90
int tilesperplayer
Definition map_types.h:91
randseed seed_setting
Definition map_types.h:92
bool altitude_info
Definition map_types.h:74
struct iter_index * iterate_outwards_indices
Definition map_types.h:77
int landpercent
Definition map_types.h:98
enum team_placement team_placement
Definition map_types.h:110
int topology_id
Definition map_types.h:72
enum direction8 cardinal_dirs[8]
Definition map_types.h:75
int flatpoles
Definition map_types.h:103
int huts
Definition map_types.h:95
int wrap_id
Definition map_types.h:73
bool have_huts
Definition map_types.h:108
enum map_generator generator
Definition map_types.h:99
bool ocean_resources
Definition map_types.h:107
bool separatepoles
Definition map_types.h:102
int temperature
Definition map_types.h:104
int huts_absolute
Definition map_types.h:96
Definition map.c:40
Definition tile.h:50