Freeciv-3.1
Loading...
Searching...
No Matches
maphand.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__MAPHAND_H
14#define FC__MAPHAND_H
15
16/* common */
17#include "fc_types.h"
18#include "map.h"
19#include "packets.h"
20#include "terrain.h"
21#include "vision.h"
22
23/* server */
24#include <hand_gen.h> /* <> so looked from the build directory first. */
25
26struct section_file;
27struct conn_list;
28
29
31 struct vision_site *site; /* NULL for no vision site */
32 struct extra_type *resource; /* NULL for no resource */
33 struct terrain *terrain; /* NULL for unknown tiles */
34 struct player *owner; /* NULL for unowned */
36 bv_extras extras;
37
38 /* If you build a city with an unknown square within city radius
39 the square stays unknown. However, we still have to keep count
40 of the seen points, so they are kept in here. When the tile
41 then becomes known they are moved to seen. */
45};
46
47void global_warming(int effect);
48void nuclear_winter(int effect);
49void climate_change(bool warming, int effect);
50bool upgrade_city_extras(struct city *pcity, struct extra_type **gained);
51void upgrade_all_city_extras(struct player *pplayer, bool discovery);
52
53void give_map_from_player_to_player(struct player *pfrom, struct player *pdest);
54void give_seamap_from_player_to_player(struct player *pfrom, struct player *pdest);
56 struct player *pfrom, struct player *pdest);
57void send_all_known_tiles(struct conn_list *dest);
58
59bool send_tile_suppression(bool now);
60void send_tile_info(struct conn_list *dest, struct tile *ptile,
61 bool send_unknown);
62
63void send_map_info(struct conn_list *dest);
64
65void map_show_tile(struct player *pplayer, struct tile *ptile);
66void map_hide_tile(struct player *pplayer, struct tile *ptile);
67void map_show_circle(struct player *pplayer,
68 struct tile *ptile, int radius_sq);
69void map_vision_update(struct player *pplayer, struct tile *ptile,
70 const v_radius_t old_radius_sq,
71 const v_radius_t new_radius_sq,
72 bool can_reveal_tiles);
73void map_set_border_vision(struct player *pplayer,
74 const bool is_enabled);
75void map_show_all(struct player *pplayer);
76
77bool map_is_known_and_seen(const struct tile *ptile,
78 const struct player *pplayer,
79 enum vision_layer vlayer);
80bool map_is_known(const struct tile *ptile, const struct player *pplayer);
81void map_set_known(struct tile *ptile, struct player *pplayer);
82void map_clear_known(struct tile *ptile, struct player *pplayer);
83void map_know_and_see_all(struct player *pplayer);
84void show_map_to_all(void);
85
86void player_map_init(struct player *pplayer);
87void player_map_free(struct player *pplayer);
88void remove_player_from_maps(struct player *pplayer);
89
90struct vision_site *map_get_player_city(const struct tile *ptile,
91 const struct player *pplayer);
92struct vision_site *map_get_player_site(const struct tile *ptile,
93 const struct player *pplayer);
94struct player_tile *map_get_player_tile(const struct tile *ptile,
95 const struct player *pplayer);
96bool update_player_tile_knowledge(struct player *pplayer, struct tile *ptile);
97void update_tile_knowledge(struct tile *ptile);
98void update_player_tile_last_seen(struct player *pplayer, struct tile *ptile);
99
100void give_shared_vision(struct player *pfrom, struct player *pto);
101void remove_shared_vision(struct player *pfrom, struct player *pto);
102bool really_gives_vision(struct player *me, struct player *them);
103
104void enable_fog_of_war(void);
105void disable_fog_of_war(void);
106void enable_fog_of_war_player(struct player *pplayer);
107void disable_fog_of_war_player(struct player *pplayer);
108
109void map_calculate_borders(void);
110void map_claim_border(struct tile *ptile, struct player *powner,
111 int radius_sq);
112void map_claim_ownership(struct tile *ptile, struct player *powner,
113 struct tile *psource, bool claim_bases);
114void map_clear_border(struct tile *ptile);
115void map_update_border(struct tile *ptile, struct player *owner,
116 int old_radius_sq, int new_radius_sq);
117
118void tile_claim_bases(struct tile *ptile, struct player *powner);
119void map_claim_base(struct tile *ptile, struct extra_type *pextra,
120 struct player *powner, struct player *ploser);
121
122void terrain_changed(struct tile *ptile);
123void check_terrain_change(struct tile *ptile, struct terrain *oldter);
124void fix_tile_on_terrain_change(struct tile *ptile,
125 struct terrain *oldter,
126 bool extend_rivers);
127bool need_to_reassign_continents(const struct terrain *oldter,
128 const struct terrain *newter);
129void bounce_units_on_terrain_change(struct tile *ptile);
130
132 const v_radius_t radius_sq);
133void vision_clear_sight(struct vision *vision);
134
135void change_playertile_site(struct player_tile *ptile,
136 struct vision_site *new_site);
137
138void create_extra(struct tile *ptile, struct extra_type *pextra,
139 struct player *pplayer);
140void destroy_extra(struct tile *ptile, struct extra_type *pextra);
141
142bool give_distorted_map(struct player *pfrom, struct player *pto,
143 int prob, bool reveal_cities);
144
145void tile_change_side_effects(struct tile *ptile, bool refresh_city)
146 fc__attribute((nonnull (1)));
147
148#endif /* FC__MAPHAND_H */
struct city * owner
Definition citydlg.c:219
void player_map_init(struct player *pplayer)
Definition maphand.c:1202
void update_player_tile_last_seen(struct player *pplayer, struct tile *ptile)
Definition maphand.c:1455
void vision_clear_sight(struct vision *vision)
Definition maphand.c:2517
void map_show_tile(struct player *pplayer, struct tile *ptile)
Definition maphand.c:760
void map_claim_base(struct tile *ptile, struct extra_type *pextra, struct player *powner, struct player *ploser)
Definition maphand.c:2384
void map_set_border_vision(struct player *pplayer, const bool is_enabled)
Definition maphand.c:732
void map_claim_ownership(struct tile *ptile, struct player *powner, struct tile *psource, bool claim_bases)
Definition maphand.c:2191
bool map_is_known(const struct tile *ptile, const struct player *pplayer)
Definition maphand.c:886
void send_map_info(struct conn_list *dest)
Definition maphand.c:644
bool send_tile_suppression(bool now)
Definition maphand.c:472
void destroy_extra(struct tile *ptile, struct extra_type *pextra)
Definition maphand.c:2605
void disable_fog_of_war(void)
Definition maphand.c:1773
bool really_gives_vision(struct player *me, struct player *them)
Definition maphand.c:342
void map_know_and_see_all(struct player *pplayer)
Definition maphand.c:1177
void show_map_to_all(void)
Definition maphand.c:1191
void send_tile_info(struct conn_list *dest, struct tile *ptile, bool send_unknown)
Definition maphand.c:488
bool update_player_tile_knowledge(struct player *pplayer, struct tile *ptile)
Definition maphand.c:1386
void give_map_from_player_to_player(struct player *pfrom, struct player *pdest)
Definition maphand.c:381
void send_all_known_tiles(struct conn_list *dest)
Definition maphand.c:441
void bounce_units_on_terrain_change(struct tile *ptile)
Definition maphand.c:1903
void give_seamap_from_player_to_player(struct player *pfrom, struct player *pdest)
Definition maphand.c:397
void remove_shared_vision(struct player *pfrom, struct player *pto)
Definition maphand.c:1681
bool need_to_reassign_continents(const struct terrain *oldter, const struct terrain *newter)
Definition maphand.c:1921
struct vision_site * map_get_player_city(const struct tile *ptile, const struct player *pplayer)
Definition maphand.c:1346
void tile_claim_bases(struct tile *ptile, struct player *powner)
Definition maphand.c:2204
void disable_fog_of_war_player(struct player *pplayer)
Definition maphand.c:1759
void climate_change(bool warming, int effect)
Definition maphand.c:130
void enable_fog_of_war(void)
Definition maphand.c:1749
void upgrade_all_city_extras(struct player *pplayer, bool discovery)
Definition maphand.c:273
void create_extra(struct tile *ptile, struct extra_type *pextra, struct player *pplayer)
Definition maphand.c:2540
void map_update_border(struct tile *ptile, struct player *owner, int old_radius_sq, int new_radius_sq)
Definition maphand.c:2238
void map_set_known(struct tile *ptile, struct player *pplayer)
Definition maphand.c:1159
void map_show_all(struct player *pplayer)
Definition maphand.c:871
void map_hide_tile(struct player *pplayer, struct tile *ptile)
Definition maphand.c:812
void give_citymap_from_player_to_player(struct city *pcity, struct player *pfrom, struct player *pdest)
Definition maphand.c:415
void nuclear_winter(int effect)
Definition maphand.c:116
void terrain_changed(struct tile *ptile)
Definition maphand.c:1940
void player_map_free(struct player *pplayer)
Definition maphand.c:1218
bool map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
Definition maphand.c:900
void change_playertile_site(struct player_tile *ptile, struct vision_site *new_site)
Definition maphand.c:1140
void map_calculate_borders(void)
Definition maphand.c:2357
void fix_tile_on_terrain_change(struct tile *ptile, struct terrain *oldter, bool extend_rivers)
Definition maphand.c:1959
void enable_fog_of_war_player(struct player *pplayer)
Definition maphand.c:1735
void map_show_circle(struct player *pplayer, struct tile *ptile, int radius_sq)
Definition maphand.c:856
void map_vision_update(struct player *pplayer, struct tile *ptile, const v_radius_t old_radius_sq, const v_radius_t new_radius_sq, bool can_reveal_tiles)
Definition maphand.c:677
void update_tile_knowledge(struct tile *ptile)
Definition maphand.c:1427
void map_claim_border(struct tile *ptile, struct player *powner, int radius_sq)
Definition maphand.c:2270
void remove_player_from_maps(struct player *pplayer)
Definition maphand.c:1239
void give_shared_vision(struct player *pfrom, struct player *pto)
Definition maphand.c:1620
void check_terrain_change(struct tile *ptile, struct terrain *oldter)
Definition maphand.c:1979
bool give_distorted_map(struct player *pfrom, struct player *pto, int prob, bool reveal_cities)
Definition maphand.c:2680
struct vision_site * map_get_player_site(const struct tile *ptile, const struct player *pplayer)
Definition maphand.c:1359
void global_warming(int effect)
Definition maphand.c:103
bool upgrade_city_extras(struct city *pcity, struct extra_type **gained)
Definition maphand.c:238
void map_clear_border(struct tile *ptile)
Definition maphand.c:2221
void map_clear_known(struct tile *ptile, struct player *pplayer)
Definition maphand.c:1167
void tile_change_side_effects(struct tile *ptile, bool refresh_city) fc__attribute((nonnull(1)))
Definition maphand.c:2708
struct player_tile * map_get_player_tile(const struct tile *ptile, const struct player *pplayer)
Definition maphand.c:1370
void vision_change_sight(struct vision *vision, const v_radius_t radius_sq)
Definition maphand.c:2505
Definition city.h:309
bv_extras extras
Definition maphand.h:36
struct player * extras_owner
Definition maphand.h:35
v_radius_t seen_count
Definition maphand.h:43
struct vision_site * site
Definition maphand.h:31
v_radius_t own_seen
Definition maphand.h:42
struct terrain * terrain
Definition maphand.h:33
short last_updated
Definition maphand.h:44
struct player * owner
Definition maphand.h:34
struct extra_type * resource
Definition maphand.h:32
Definition tile.h:49
#define fc__attribute(x)
Definition support.h:89
short int v_radius_t[V_COUNT]
Definition vision.h:83