Freeciv-3.1: /fast/freeciv/nightly/S3_1/server/maphand.h Source File

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
30 struct player_tile {
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 */
35 struct player *extras_owner;
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. */
42 v_radius_t own_seen;
43 v_radius_t seen_count;
44 short last_updated;
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);
55void give_citymap_from_player_to_player(struct city *pcity,
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
131void vision_change_sight(struct vision *vision,
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 */
fc_types.h
owner
struct city * owner
Definition citydlg.c:219
hand_gen.h
map.h
player_map_init
void player_map_init(struct player *pplayer)
Definition maphand.c:1202
update_player_tile_last_seen
void update_player_tile_last_seen(struct player *pplayer, struct tile *ptile)
Definition maphand.c:1455
vision_clear_sight
void vision_clear_sight(struct vision *vision)
Definition maphand.c:2517
map_show_tile
void map_show_tile(struct player *pplayer, struct tile *ptile)
Definition maphand.c:760
map_claim_base
void map_claim_base(struct tile *ptile, struct extra_type *pextra, struct player *powner, struct player *ploser)
Definition maphand.c:2384
map_set_border_vision
void map_set_border_vision(struct player *pplayer, const bool is_enabled)
Definition maphand.c:732
map_claim_ownership
void map_claim_ownership(struct tile *ptile, struct player *powner, struct tile *psource, bool claim_bases)
Definition maphand.c:2191
map_is_known
bool map_is_known(const struct tile *ptile, const struct player *pplayer)
Definition maphand.c:886
send_map_info
void send_map_info(struct conn_list *dest)
Definition maphand.c:644
send_tile_suppression
bool send_tile_suppression(bool now)
Definition maphand.c:472
destroy_extra
void destroy_extra(struct tile *ptile, struct extra_type *pextra)
Definition maphand.c:2605
disable_fog_of_war
void disable_fog_of_war(void)
Definition maphand.c:1773
really_gives_vision
bool really_gives_vision(struct player *me, struct player *them)
Definition maphand.c:342
map_know_and_see_all
void map_know_and_see_all(struct player *pplayer)
Definition maphand.c:1177
show_map_to_all
void show_map_to_all(void)
Definition maphand.c:1191
send_tile_info
void send_tile_info(struct conn_list *dest, struct tile *ptile, bool send_unknown)
Definition maphand.c:488
update_player_tile_knowledge
bool update_player_tile_knowledge(struct player *pplayer, struct tile *ptile)
Definition maphand.c:1386
give_map_from_player_to_player
void give_map_from_player_to_player(struct player *pfrom, struct player *pdest)
Definition maphand.c:381
send_all_known_tiles
void send_all_known_tiles(struct conn_list *dest)
Definition maphand.c:441
bounce_units_on_terrain_change
void bounce_units_on_terrain_change(struct tile *ptile)
Definition maphand.c:1903
give_seamap_from_player_to_player
void give_seamap_from_player_to_player(struct player *pfrom, struct player *pdest)
Definition maphand.c:397
remove_shared_vision
void remove_shared_vision(struct player *pfrom, struct player *pto)
Definition maphand.c:1681
need_to_reassign_continents
bool need_to_reassign_continents(const struct terrain *oldter, const struct terrain *newter)
Definition maphand.c:1921
map_get_player_city
struct vision_site * map_get_player_city(const struct tile *ptile, const struct player *pplayer)
Definition maphand.c:1346
tile_claim_bases
void tile_claim_bases(struct tile *ptile, struct player *powner)
Definition maphand.c:2204
disable_fog_of_war_player
void disable_fog_of_war_player(struct player *pplayer)
Definition maphand.c:1759
climate_change
void climate_change(bool warming, int effect)
Definition maphand.c:130
enable_fog_of_war
void enable_fog_of_war(void)
Definition maphand.c:1749
upgrade_all_city_extras
void upgrade_all_city_extras(struct player *pplayer, bool discovery)
Definition maphand.c:273
create_extra
void create_extra(struct tile *ptile, struct extra_type *pextra, struct player *pplayer)
Definition maphand.c:2540
map_update_border
void map_update_border(struct tile *ptile, struct player *owner, int old_radius_sq, int new_radius_sq)
Definition maphand.c:2238
map_set_known
void map_set_known(struct tile *ptile, struct player *pplayer)
Definition maphand.c:1159
map_show_all
void map_show_all(struct player *pplayer)
Definition maphand.c:871
map_hide_tile
void map_hide_tile(struct player *pplayer, struct tile *ptile)
Definition maphand.c:812
give_citymap_from_player_to_player
void give_citymap_from_player_to_player(struct city *pcity, struct player *pfrom, struct player *pdest)
Definition maphand.c:415
nuclear_winter
void nuclear_winter(int effect)
Definition maphand.c:116
terrain_changed
void terrain_changed(struct tile *ptile)
Definition maphand.c:1940
player_map_free
void player_map_free(struct player *pplayer)
Definition maphand.c:1218
map_is_known_and_seen
bool map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
Definition maphand.c:900
change_playertile_site
void change_playertile_site(struct player_tile *ptile, struct vision_site *new_site)
Definition maphand.c:1140
map_calculate_borders
void map_calculate_borders(void)
Definition maphand.c:2357
fix_tile_on_terrain_change
void fix_tile_on_terrain_change(struct tile *ptile, struct terrain *oldter, bool extend_rivers)
Definition maphand.c:1959
enable_fog_of_war_player
void enable_fog_of_war_player(struct player *pplayer)
Definition maphand.c:1735
map_show_circle
void map_show_circle(struct player *pplayer, struct tile *ptile, int radius_sq)
Definition maphand.c:856
map_vision_update
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
update_tile_knowledge
void update_tile_knowledge(struct tile *ptile)
Definition maphand.c:1427
map_claim_border
void map_claim_border(struct tile *ptile, struct player *powner, int radius_sq)
Definition maphand.c:2270
remove_player_from_maps
void remove_player_from_maps(struct player *pplayer)
Definition maphand.c:1239
give_shared_vision
void give_shared_vision(struct player *pfrom, struct player *pto)
Definition maphand.c:1620
check_terrain_change
void check_terrain_change(struct tile *ptile, struct terrain *oldter)
Definition maphand.c:1979
give_distorted_map
bool give_distorted_map(struct player *pfrom, struct player *pto, int prob, bool reveal_cities)
Definition maphand.c:2680
map_get_player_site
struct vision_site * map_get_player_site(const struct tile *ptile, const struct player *pplayer)
Definition maphand.c:1359
global_warming
void global_warming(int effect)
Definition maphand.c:103
upgrade_city_extras
bool upgrade_city_extras(struct city *pcity, struct extra_type **gained)
Definition maphand.c:238
map_clear_border
void map_clear_border(struct tile *ptile)
Definition maphand.c:2221
map_clear_known
void map_clear_known(struct tile *ptile, struct player *pplayer)
Definition maphand.c:1167
tile_change_side_effects
void tile_change_side_effects(struct tile *ptile, bool refresh_city) fc__attribute((nonnull(1)))
Definition maphand.c:2708
map_get_player_tile
struct player_tile * map_get_player_tile(const struct tile *ptile, const struct player *pplayer)
Definition maphand.c:1370
vision_change_sight
void vision_change_sight(struct vision *vision, const v_radius_t radius_sq)
Definition maphand.c:2505
packets.h
city
Definition city.h:309
effect
Definition effects.h:340
extra_type
Definition extras.h:85
player_tile
Definition maphand.h:30
player_tile::extras
bv_extras extras
Definition maphand.h:36
player_tile::extras_owner
struct player * extras_owner
Definition maphand.h:35
player_tile::seen_count
v_radius_t seen_count
Definition maphand.h:43
player_tile::site
struct vision_site * site
Definition maphand.h:31
player_tile::own_seen
v_radius_t own_seen
Definition maphand.h:42
player_tile::terrain
struct terrain * terrain
Definition maphand.h:33
player_tile::last_updated
short last_updated
Definition maphand.h:44
player_tile::owner
struct player * owner
Definition maphand.h:34
player_tile::resource
struct extra_type * resource
Definition maphand.h:32
player
Definition player.h:249
section_file
Definition section_file.h:36
terrain
Definition terrain.h:176
tile
Definition tile.h:49
vision_site
Definition vision.h:109
vision
Definition vision.h:85
fc__attribute
#define fc__attribute(x)
Definition support.h:89
terrain.h
vision.h
v_radius_t
short int v_radius_t[V_COUNT]
Definition vision.h:83