]> git.pond.sub.org Git - empserver/blob - include/update.h
Make: Get SHELL from Autoconf
[empserver] / include / update.h
1 /*
2  *  Empire - A multi-player, client/server Internet based war game.
3  *  Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
4  *                Ken Stevens, Steve McClure, Markus Armbruster
5  *
6  *  Empire is free software: you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation, either version 3 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  *
19  *  ---
20  *
21  *  See files README, COPYING and CREDITS in the root of the source
22  *  tree for related information and legal notices.  It is expected
23  *  that future projects/authors will amend these files as needed.
24  *
25  *  ---
26  *
27  *  update.h: Definitions related to the update
28  *
29  *  Known contributors to this file:
30  *     Ville Virrankoski, 1995
31  *     Markus Armbruster, 2004-2020
32  */
33
34 #ifndef UPDATE_H
35 #define UPDATE_H
36
37 #include "sect.h"
38
39 #define IMPORT  0
40 #define EXPORT  1
41
42 enum {
43     BUDG_SHP_BUILD,
44     BUDG_SHP_MAINT,
45     BUDG_PLN_BUILD,
46     BUDG_PLN_MAINT,
47     BUDG_LND_BUILD,
48     BUDG_LND_MAINT,
49     BUDG_SCT_BUILD,
50     BUDG_SCT_MAINT,
51     BUDG_BLD_MAX = BUDG_SCT_MAINT
52 };
53
54 struct budg_item {
55     double money;               /* money delta */
56     int count;                  /* #things making/consuming the money */
57 };
58
59 /* A nation's budget for an update */
60 struct budget {
61     /* production by sector type */
62     struct budg_item prod[ARRAY_SIZE(dchr) - 1];
63     /* level production output */
64     float level[4];
65     /* building and maintenance */
66     struct budg_item bm[BUDG_BLD_MAX + 1];
67     /* population, taxes, military payroll, bank interest */
68     struct budg_item civ, mil, uw, bars;
69     /* treasury */
70     int start_money;            /* at beginning of update */
71     double money;               /* current */
72     /* population before growth */
73     int oldowned_civs;
74 };
75
76 /* main.c */
77 extern int update_running;
78 extern struct budget nat_budget[MAXNOC];
79
80 /* age.c */
81 extern int age_people(int, int);
82 extern void age_levels(int);
83 /* anno.c */
84 extern void delete_old_announcements(void);
85 /* bp.c */
86 extern struct bp *bp_alloc(void);
87 extern int bp_skip_sect(struct bp *, struct sctstr *);
88 extern int bp_skip_unit(struct bp *, struct empobj *);
89 extern void bp_consider_unit(struct bp *, struct empobj *);
90 extern void bp_set_from_sect(struct bp *, struct sctstr *);
91 extern void bp_to_sect(struct bp *, struct sctstr *);
92 /* deliver.c */
93 extern void dodeliver(struct sctstr *);
94 /* distribute.c */
95 extern int dodistribute(struct sctstr *, int, double);
96 /* fallout.c */
97 extern void fallout(int);
98 /* finish.c */
99 extern void finish_sects(int);
100 /* human.c */
101 extern void do_feed(struct sctstr *, struct natstr *, int, int);
102 extern int feed_people(short *, int);
103 extern double food_needed(short *, int);
104 extern int famine_victims(short *, int);
105 /* land.c */
106 extern void prep_lands(int, struct bp *);
107 extern void prod_land(int, struct bp *, int);
108 /* main.c */
109 /* in server.h */
110 /* material.c */
111 extern int get_materials(struct sctstr *, short[], int);
112 /* mobility.c */
113 extern void mob_inc_all(int);
114 extern void mob_inc_sect(struct sctstr *, int);
115 extern void mob_inc_ship(struct shpstr *, int);
116 extern void mob_inc_plane(struct plnstr *, int);
117 extern void mob_inc_land(struct lndstr *, int);
118 extern void mob_access_all(void);
119 /* move_sat.c */
120 extern void move_sat(struct plnstr *);
121 /* nat.c */
122 extern void prod_nat(int);
123 /* nxtitemp.c */
124 /* in nsc.h */
125 /* plague.c */
126 extern void do_plague(struct sctstr *, int);
127 extern int plague_people(struct natstr *, short *, int *, int *, int);
128 extern void plague_report(natid, int, int, int, int, char *, char *);
129 /* plane.c */
130 extern void prep_planes(int, struct bp *);
131 extern void prod_plane(int, struct bp *, int);
132 /* populace.c */
133 extern void check_pop_loss(struct sctstr *);
134 extern void populace(struct sctstr *, int);
135 extern int total_work(int, int, int, int, int, int);
136 /* prepare.c */
137 extern void prepare_sects(int, struct bp *);
138 extern void prep_one_sect(struct sctstr *, int, struct bp *);
139 extern void pay_reserve(struct natstr *, int);
140 /* produce.c */
141 extern void produce(struct natstr *, struct sctstr *);
142 extern double prod_output(struct sctstr *, double);
143 extern double prod_materials_cost(struct pchrstr *, short[], int *);
144 extern double prod_resource_limit(struct pchrstr *, unsigned char *);
145 extern double prod_eff(int, float);
146 /* removewants.c */
147 extern int update_removewants(void);
148 /* revolt.c */
149 extern void revolt(struct sctstr *);
150 extern void guerrilla(struct sctstr *);
151 /* sect.c */
152 extern double buildeff(struct sctstr *);
153 extern void produce_sect(int, struct bp *);
154 /* ship.c */
155 extern void prep_ships(int, struct bp *);
156 extern void prod_ship(int, struct bp *, int);
157
158 #endif