Freeciv-3.3
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 struct dbv 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
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,
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);
92#define map_get_playermap_site(_plrtile_) (_plrtile_)->site
93#define map_get_player_site(_ptile_, _pplayer_) \
94 map_get_playermap_site(map_get_player_tile(_ptile_, _pplayer_))
95
96struct player_tile *map_get_player_tile(const struct tile *ptile,
97 const struct player *pplayer);
98bool update_player_tile_knowledge(struct player *pplayer, struct tile *ptile);
99void update_tile_knowledge(struct tile *ptile);
100void update_player_tile_last_seen(struct player *pplayer, struct tile *ptile);
101
102void give_shared_vision(struct player *pfrom, struct player *pto);
103void remove_shared_vision(struct player *pfrom, struct player *pto);
104bool really_gives_vision(struct player *me, struct player *them);
105
106void enable_fog_of_war(void);
107void disable_fog_of_war(void);
108void enable_fog_of_war_player(struct player *pplayer);
109void disable_fog_of_war_player(struct player *pplayer);
110
111void map_calculate_borders(void);
112void map_claim_border(struct tile *ptile, struct player *powner,
113 int radius_sq);
114void map_claim_ownership(struct tile *ptile, struct player *powner,
115 struct tile *psource, bool claim_bases);
116void map_clear_border(struct tile *ptile);
117void map_update_border(struct tile *ptile, struct player *owner,
119
120void tile_claim_bases(struct tile *ptile, struct player *powner);
121void map_claim_base(struct tile *ptile, struct extra_type *pextra,
122 struct player *powner, struct player *ploser);
123
124void terrain_changed(struct tile *ptile);
125void check_terrain_change(struct tile *ptile, struct terrain *oldter);
126void fix_tile_on_terrain_change(struct tile *ptile,
127 struct terrain *oldter,
128 bool extend_rivers);
130 const struct terrain *newter);
131void bounce_units_on_terrain_change(struct tile *ptile);
132
134 const v_radius_t radius_sq);
135void vision_clear_sight(struct vision *vision);
136
137void change_playertile_site(struct player_tile *ptile,
138 struct vision_site *new_site);
139
140void create_extra(struct tile *ptile, struct extra_type *pextra,
141 struct player *pplayer);
142void destroy_extra(struct tile *ptile, struct extra_type *pextra);
143
144bool give_distorted_map(struct player *pfrom, struct player *pto,
145 int prob, bool reveal_cities);
146
147void tile_change_side_effects(struct tile *ptile, bool refresh_city)
148 fc__attribute((nonnull (1)));
149
150#endif /* FC__MAPHAND_H */
char * incite_cost
Definition comments.c:76
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int const struct action *paction struct unit struct city * pcity
Definition dialogs_g.h:78
struct city * owner
Definition citydlg.c:226
void player_map_init(struct player *pplayer)
Definition maphand.c:1226
void update_player_tile_last_seen(struct player *pplayer, struct tile *ptile)
Definition maphand.c:1472
void vision_clear_sight(struct vision *vision)
Definition maphand.c:2489
void map_show_tile(struct player *pplayer, struct tile *ptile)
Definition maphand.c:773
void map_claim_base(struct tile *ptile, struct extra_type *pextra, struct player *powner, struct player *ploser)
Definition maphand.c:2356
void map_set_border_vision(struct player *pplayer, const bool is_enabled)
Definition maphand.c:745
void map_claim_ownership(struct tile *ptile, struct player *powner, struct tile *psource, bool claim_bases)
Definition maphand.c:2171
bool map_is_known(const struct tile *ptile, const struct player *pplayer)
Definition maphand.c:899
void send_map_info(struct conn_list *dest)
Definition maphand.c:653
bool send_tile_suppression(bool now)
Definition maphand.c:473
void destroy_extra(struct tile *ptile, struct extra_type *pextra)
Definition maphand.c:2577
void disable_fog_of_war(void)
Definition maphand.c:1794
bool really_gives_vision(struct player *me, struct player *them)
Definition maphand.c:343
void map_know_and_see_all(struct player *pplayer)
Definition maphand.c:1201
void show_map_to_all(void)
Definition maphand.c:1215
void send_tile_info(struct conn_list *dest, struct tile *ptile, bool send_unknown)
Definition maphand.c:489
bool update_player_tile_knowledge(struct player *pplayer, struct tile *ptile)
Definition maphand.c:1403
void give_map_from_player_to_player(struct player *pfrom, struct player *pdest)
Definition maphand.c:382
void send_all_known_tiles(struct conn_list *dest)
Definition maphand.c:442
void bounce_units_on_terrain_change(struct tile *ptile)
Definition maphand.c:1926
void give_seamap_from_player_to_player(struct player *pfrom, struct player *pdest)
Definition maphand.c:398
void remove_shared_vision(struct player *pfrom, struct player *pto)
Definition maphand.c:1698
bool need_to_reassign_continents(const struct terrain *oldter, const struct terrain *newter)
Definition maphand.c:1944
struct vision_site * map_get_player_city(const struct tile *ptile, const struct player *pplayer)
Definition maphand.c:1372
void tile_claim_bases(struct tile *ptile, struct player *powner)
Definition maphand.c:2184
void disable_fog_of_war_player(struct player *pplayer)
Definition maphand.c:1778
void climate_change(bool warming, int effect)
Definition maphand.c:131
void enable_fog_of_war(void)
Definition maphand.c:1768
void upgrade_all_city_extras(struct player *pplayer, bool discovery)
Definition maphand.c:274
void create_extra(struct tile *ptile, struct extra_type *pextra, struct player *pplayer)
Definition maphand.c:2512
void map_update_border(struct tile *ptile, struct player *owner, int old_radius_sq, int new_radius_sq)
Definition maphand.c:2218
void map_set_known(struct tile *ptile, struct player *pplayer)
Definition maphand.c:1183
void map_show_all(struct player *pplayer)
Definition maphand.c:884
void map_hide_tile(struct player *pplayer, struct tile *ptile)
Definition maphand.c:825
void give_citymap_from_player_to_player(struct city *pcity, struct player *pfrom, struct player *pdest)
Definition maphand.c:416
void nuclear_winter(int effect)
Definition maphand.c:117
void terrain_changed(struct tile *ptile)
Definition maphand.c:1963
void player_map_free(struct player *pplayer)
Definition maphand.c:1242
bool map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
Definition maphand.c:925
void change_playertile_site(struct player_tile *ptile, struct vision_site *new_site)
Definition maphand.c:1164
void map_calculate_borders(void)
Definition maphand.c:2329
void fix_tile_on_terrain_change(struct tile *ptile, struct terrain *oldter, bool extend_rivers)
Definition maphand.c:1982
void enable_fog_of_war_player(struct player *pplayer)
Definition maphand.c:1752
void map_show_circle(struct player *pplayer, struct tile *ptile, int radius_sq)
Definition maphand.c:869
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:690
void update_tile_knowledge(struct tile *ptile)
Definition maphand.c:1444
void map_claim_border(struct tile *ptile, struct player *powner, int radius_sq)
Definition maphand.c:2250
void remove_player_from_maps(struct player *pplayer)
Definition maphand.c:1263
void give_shared_vision(struct player *pfrom, struct player *pto)
Definition maphand.c:1637
void check_terrain_change(struct tile *ptile, struct terrain *oldter)
Definition maphand.c:2002
bool give_distorted_map(struct player *pfrom, struct player *pto, int prob, bool reveal_cities)
Definition maphand.c:2652
void global_warming(int effect)
Definition maphand.c:104
bool upgrade_city_extras(struct city *pcity, struct extra_type **gained)
Definition maphand.c:239
void map_clear_border(struct tile *ptile)
Definition maphand.c:2201
void map_clear_known(struct tile *ptile, struct player *pplayer)
Definition maphand.c:1191
void tile_change_side_effects(struct tile *ptile, bool refresh_city) fc__attribute((nonnull(1)))
Definition maphand.c:2680
struct player_tile * map_get_player_tile(const struct tile *ptile, const struct player *pplayer)
Definition maphand.c:1387
void vision_change_sight(struct vision *vision, const v_radius_t radius_sq)
Definition maphand.c:2477
Definition city.h:317
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
struct dbv extras
Definition maphand.h:36
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:50
#define fc__attribute(x)
Definition support.h:99
short int v_radius_t[V_COUNT]
Definition vision.h:83