Some miscellaneous updates to main help, for new features and otherwise.
[freeciv.git] / server / maphand.h
blob8d7a07ddcbf954aabac52e5c1da9000144817baa
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__MAPHAND_H
14 #define FC__MAPHAND_H
16 #include "fc_types.h"
18 #include "map.h"
19 #include "packets.h"
20 #include "terrain.h"
21 #include "vision.h"
23 #include "hand_gen.h"
25 struct section_file;
26 struct conn_list;
29 struct player_tile {
30 struct vision_site *site; /* NULL for no vision site */
31 struct resource *resource; /* NULL for no resource */
32 struct terrain *terrain; /* NULL for unknown tiles */
33 struct player *owner; /* NULL for unowned */
34 bv_special special;
35 bv_bases bases;
36 bv_roads roads;
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. */
42 v_radius_t own_seen;
43 v_radius_t seen_count;
44 short last_updated;
47 void global_warming(int effect);
48 void nuclear_winter(int effect);
49 void climate_change(bool warming, int effect);
50 bool upgrade_city_roads(struct city *pcity, struct road_type **gained);
51 void upgrade_all_city_roads(struct player *pplayer, bool discovery);
52 bool upgrade_city_bases(struct city *pcity, struct base_type **gained);
53 void upgrade_all_city_bases(struct player *pplayer, bool discovery);
55 void give_map_from_player_to_player(struct player *pfrom, struct player *pdest);
56 void give_seamap_from_player_to_player(struct player *pfrom, struct player *pdest);
57 void give_citymap_from_player_to_player(struct city *pcity,
58 struct player *pfrom, struct player *pdest);
59 void send_all_known_tiles(struct conn_list *dest);
61 bool send_tile_suppression(bool now);
62 void send_tile_info(struct conn_list *dest, struct tile *ptile,
63 bool send_unknown);
65 void send_map_info(struct conn_list *dest);
67 void map_show_tile(struct player *pplayer, struct tile *ptile);
68 void map_hide_tile(struct player *pplayer, struct tile *ptile);
69 void map_show_circle(struct player *pplayer,
70 struct tile *ptile, int radius_sq);
71 void map_vision_update(struct player *pplayer, struct tile *ptile,
72 const v_radius_t old_radius_sq,
73 const v_radius_t new_radius_sq,
74 bool can_reveal_tiles);
75 void map_show_all(struct player *pplayer);
77 bool map_is_known_and_seen(const struct tile *ptile,
78 const struct player *pplayer,
79 enum vision_layer vlayer);
80 bool map_is_known(const struct tile *ptile, const struct player *pplayer);
81 void map_set_known(struct tile *ptile, struct player *pplayer);
82 void map_clear_known(struct tile *ptile, struct player *pplayer);
83 void map_know_and_see_all(struct player *pplayer);
84 void show_map_to_all(void);
86 void player_map_init(struct player *pplayer);
87 void player_map_free(struct player *pplayer);
88 void remove_player_from_maps(struct player *pplayer);
90 struct vision_site *map_get_player_city(const struct tile *ptile,
91 const struct player *pplayer);
92 struct vision_site *map_get_player_site(const struct tile *ptile,
93 const struct player *pplayer);
94 struct player_tile *map_get_player_tile(const struct tile *ptile,
95 const struct player *pplayer);
96 bool update_player_tile_knowledge(struct player *pplayer,struct tile *ptile);
97 void update_tile_knowledge(struct tile *ptile);
98 void update_player_tile_last_seen(struct player *pplayer, struct tile *ptile);
100 void give_shared_vision(struct player *pfrom, struct player *pto);
101 void remove_shared_vision(struct player *pfrom, struct player *pto);
102 bool really_gives_vision(struct player *me, struct player *them);
104 void enable_fog_of_war(void);
105 void disable_fog_of_war(void);
106 void enable_fog_of_war_player(struct player *pplayer);
107 void disable_fog_of_war_player(struct player *pplayer);
109 void map_calculate_borders(void);
110 void map_claim_border(struct tile *ptile, struct player *powner);
111 void map_claim_ownership(struct tile *ptile, struct player *powner,
112 struct tile *psource);
113 void map_clear_border(struct tile *ptile);
115 void map_claim_base(struct tile *ptile, struct base_type *pbase,
116 struct player *powner, struct player *ploser);
118 void terrain_changed(struct tile *ptile);
119 void check_terrain_change(struct tile *ptile, struct terrain *oldter);
120 void fix_tile_on_terrain_change(struct tile *ptile,
121 struct terrain *oldter,
122 bool extend_rivers);
123 bool need_to_reassign_continents(const struct terrain *oldter,
124 const struct terrain *newter);
125 void bounce_units_on_terrain_change(struct tile *ptile);
127 void vision_change_sight(struct vision *vision,
128 const v_radius_t radius_sq);
129 void vision_clear_sight(struct vision *vision);
131 void change_playertile_site(struct player_tile *ptile,
132 struct vision_site *new_site);
134 void create_base(struct tile *ptile, struct base_type *pbase,
135 struct player *pplayer);
136 void destroy_base(struct tile *ptile, struct base_type *pbase);
138 void give_distorted_map(struct player *pfrom, struct player *pto, int good,
139 int bad, bool reveal_cities);
141 #endif /* FC__MAPHAND_H */