Freeciv-3.3
Loading...
Searching...
No Matches
climisc.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__CLIMISC_H
14#define FC__CLIMISC_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/* common */
21#include "fc_types.h"
22#include "featured_text.h" /* struct ft_color */
23#include "events.h"
24#include "unittype.h"
25#include "unitlist.h"
26
27struct Clause;
28struct nation_type;
29struct nation_set;
30
31typedef int cid;
32
34void client_remove_city(struct city *pcity);
35void client_remove_unit(struct unit *punit);
36
37void client_change_all(struct universal *from,
38 struct universal *to);
39
40const char *get_embassy_status(const struct player *me,
41 const struct player *them);
42const char *get_vision_status(const struct player *me,
43 const struct player *them);
45 struct Clause *pclause);
46
47void global_warming_scaled(int *chance, int *rate, int max);
48void nuclear_winter_scaled(int *chance, int *rate, int max);
49
50struct sprite *client_research_sprite(void);
51struct sprite *client_warming_sprite(void);
52struct sprite *client_cooling_sprite(void);
54
55void center_on_something(void);
56
57/*
58 * A compound id (cid) can hold all objects a city can build:
59 * improvements (with wonders) and units. This is achieved by
60 * seperation the value set: a cid < B_LAST denotes a improvement
61 * (including wonders). A cid >= B_LAST denotes a unit with the
62 * unit_type_id of (cid - B_LAST).
63 */
64
65cid cid_encode(struct universal target);
67cid cid_encode_building(const struct impr_type *pimprove);
68cid cid_encode_from_city(const struct city *pcity);
69
71#define cid_production cid_decode
72
73bool city_unit_supported(const struct city *pcity,
74 const struct universal *target);
75bool city_unit_present(const struct city *pcity,
76 const struct universal *target);
77bool city_building_present(const struct city *pcity,
78 const struct universal *target);
79bool can_city_build_now_client(const struct city *pcity,
80 const struct universal *target);
81
82struct item {
84 char descr[MAX_LEN_NAME + 40];
85};
86
87typedef bool (*TestCityFunc)(const struct city *, const struct universal *);
88
89#define MAX_NUM_PRODUCTION_TARGETS (U_LAST + B_LAST)
90void name_and_sort_items(struct universal *targets, int num_items,
91 struct item *items,
92 bool show_cost, struct city *pcity);
93int collect_production_targets(struct universal *targets,
94 struct city **selected_cities,
96 bool append_wonders, bool change_prod,
99int collect_buildable_targets(struct universal *targets);
101 struct city *pcity,
102 bool advanced_tech);
103int collect_already_built_targets(struct universal *targets,
104 struct city *pcity);
105
106/* the number of units in city */
109
110void handle_event(const char *featured_text, struct tile *ptile,
111 enum event_type event, int turn, int phase, int conn_id);
112void create_event(struct tile *ptile, enum event_type event,
113 const struct ft_color color, const char *format, ...)
115
117
119void common_taxrates_callback(int idx, bool reverse);
120
121bool can_units_do_connect(struct unit_list *punits,
122 enum unit_activity activity,
123 struct extra_type *tgt);
124
126
132
134
136
137void unit_focus_set_status(struct player *pplayer);
138
139void client_player_init(struct player *pplayer);
140
141void client_player_maps_reset(void);
142
143bool mapimg_client_define(void);
144bool mapimg_client_createmap(const char *filename);
145
147bool client_nation_is_in_current_set(const struct nation_type *pnation);
148
149enum ai_level server_ai_level(void);
150
151#ifdef __cplusplus
152}
153#endif /* __cplusplus */
154
155#endif /* FC__CLIMISC_H */
int collect_eventually_buildable_targets(struct universal *targets, struct city *pcity, bool advanced_tech)
Definition climisc.c:819
bool city_unit_supported(const struct city *pcity, const struct universal *target)
Definition climisc.c:545
enum ai_level server_ai_level(void)
Definition climisc.c:1519
void client_change_all(struct universal *from, struct universal *to)
Definition climisc.c:165
cid cid_encode_building(const struct impr_type *pimprove)
Definition climisc.c:505
int collect_buildable_targets(struct universal *targets)
Definition climisc.c:788
struct universal cid_decode(cid cid)
Definition climisc.c:526
void client_player_init(struct player *pplayer)
Definition climisc.c:1373
void struct city * get_nearest_city(const struct unit *punit, int *sq_dist)
Definition climisc.c:1119
bool mapimg_client_createmap(const char *filename)
Definition climisc.c:1466
void client_remove_city(struct city *pcity)
Definition climisc.c:134
void client_unit_init_act_prob_cache(struct unit *punit)
Definition climisc.c:1259
void nuclear_winter_scaled(int *chance, int *rate, int max)
Definition climisc.c:344
const char * get_embassy_status(const struct player *me, const struct player *them)
Definition climisc.c:194
void buy_production_in_selected_cities(void)
Definition climisc.c:1317
void common_taxrates_callback(int idx, bool reverse)
Definition climisc.c:1194
bool mapimg_client_define(void)
Definition climisc.c:1409
int collect_currently_building_targets(struct universal *targets)
Definition climisc.c:756
enum unit_bg_color_type unit_color_type(const struct unit_type *punittype)
Definition climisc.c:1275
struct sprite * client_warming_sprite(void)
Definition climisc.c:377
void name_and_sort_items(struct universal *targets, int num_items, struct item *items, bool show_cost, struct city *pcity)
Definition climisc.c:650
bool can_units_do_connect(struct unit_list *punits, enum unit_activity activity, struct extra_type *tgt)
Definition climisc.c:1242
int cid
Definition climisc.h:31
void cityrep_buy(struct city *pcity)
Definition climisc.c:1155
void global_warming_scaled(int *chance, int *rate, int max)
Definition climisc.c:334
void client_player_maps_reset(void)
Definition climisc.c:1384
bool client_nation_is_in_current_set(const struct nation_type *pnation)
Definition climisc.c:1509
cid cid_encode_from_city(const struct city *pcity)
Definition climisc.c:518
bool(* TestCityFunc)(const struct city *, const struct universal *)
Definition climisc.h:87
struct sprite * client_cooling_sprite(void)
Definition climisc.c:394
struct sprite * client_research_sprite(void)
Definition climisc.c:354
void create_event(struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...) fc__attribute((__format__(__printf__
int num_present_units_in_city(struct city *pcity)
Definition climisc.c:951
cid cid_encode(struct universal target)
Definition climisc.c:483
void client_remove_unit(struct unit *punit)
Definition climisc.c:72
bool city_building_present(const struct city *pcity, const struct universal *target)
Definition climisc.c:583
struct nation_set * client_current_nation_set(void)
Definition climisc.c:1492
int num_supported_units_in_city(struct city *pcity)
Definition climisc.c:933
int collect_already_built_targets(struct universal *targets, struct city *pcity)
Definition climisc.c:913
void client_remove_player(int plrno)
void unit_focus_set_status(struct player *pplayer)
Definition climisc.c:1363
void handle_event(const char *featured_text, struct tile *ptile, enum event_type event, int turn, int phase, int conn_id)
Definition climisc.c:968
void center_on_something(void)
Definition climisc.c:430
unit_bg_color_type
Definition climisc.h:127
@ UNIT_BG_AMPHIBIOUS
Definition climisc.h:130
@ UNIT_BG_SEA
Definition climisc.h:129
@ UNIT_BG_FLYING
Definition climisc.h:131
@ UNIT_BG_LAND
Definition climisc.h:128
@ UNIT_BG_HP_LOSS
Definition climisc.h:127
cid cid_encode_unit(const struct unit_type *punittype)
Definition climisc.c:493
void client_diplomacy_clause_string(char *buf, int bufsiz, struct Clause *pclause)
Definition climisc.c:241
const char * get_vision_status(const struct player *me, const struct player *them)
Definition climisc.c:222
bool can_city_build_now_client(const struct city *pcity, const struct universal *target)
Definition climisc.c:593
struct sprite * client_government_sprite(void)
Definition climisc.c:412
bool city_unit_present(const struct city *pcity, const struct universal *target)
Definition climisc.c:564
int collect_production_targets(struct universal *targets, struct city **selected_cities, int num_selected_cities, bool append_units, bool append_wonders, bool change_prod, TestCityFunc test_func)
Definition climisc.c:700
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 * punit
Definition dialogs_g.h:74
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
enum event_type event
Definition events.c:81
#define MAX_LEN_NAME
Definition fc_types.h:66
Definition city.h:317
Definition colors.h:21
Definition climisc.h:82
char descr[MAX_LEN_NAME+40]
Definition climisc.h:84
Definition tile.h:50
Definition unit.h:140
#define fc__attribute(x)
Definition support.h:99
#define bool
Definition support.h:71