Bugs with generating ands and ors...ahh.
[repair.git] / Repair / RepairCompiler / MCC / specs / freeciv / test.struct
1 structure tile {
2   int terrain;
3   int special;
4   city *city;
5   unit_list units;
6   int known; /* A bitvector on the server side, an
7                            enum known_type on the client side.
8                            Player_no is index */
9   int sent; /* Indicates if  the client know the tile
10                            as TILE_KNOWN_NODRAW. A bitvector like known.
11                            Not used on the client side. */
12   int assigned; /* these can save a lot of CPU usage -- Syela */
13   city *worked; /* city working tile, or NULL if none */
14   short continent;
15   byte move_cost[8]; /* don't know if this helps! */
16   reserved byte[2]; /* padding */
17 }
18
19 structure unit_list {
20   int nelements;
21   genlist_link null_link;
22   genlist_link *head_link;
23   genlist_link *tail_link;
24 }
25
26 structure genlist_link {
27   genlist_link *next;
28   genlist_link *prev;
29   int dataptr;
30 }
31
32 structure tilegrid {
33   tile grid[map.xsize*map.ysize];
34 }
35
36 structure ceff_vector {
37   athing vector;
38 }
39
40 structure worklist {
41   int is_valid;
42   byte name[32];
43   int wlefs[16];
44   int wlids[16];
45 }
46
47 structure athing {
48   int ptr; /* the data */
49   int size; /* size of one object */
50   int n; /* number most recently requested */
51   int n_alloc; /* total number allocated */
52 }
53
54 structure civ_map {
55   int xsize;
56   int ysize;
57   int seed;
58   int riches;
59   bit is_earth;
60   reserved byte[3];
61   int huts;
62   int landpercent;
63   int grasssize;
64   int swampsize;
65   int deserts;
66   int mountains;
67   int riverlength;
68   int forestsize;
69   int generator;
70   int tinyisles;
71   int separatepoles;
72   int num_start_positions;
73   int fixed_start_positions;
74   int have_specials;
75   int have_huts;
76   int have_rivers_overlay;
77   int num_continents;
78   tilegrid *tiles;
79   map_position start_positions[63];
80 }
81
82 structure map_position {
83   int x;
84   int y;
85 }
86
87 structure city {
88   int id;
89   int owner;
90   int x;
91   int y;
92   byte name[32];
93
94   int size;
95   int ppl_happy[5];
96   int ppl_content[5];
97   int ppl_unhappy[5];
98   int ppl_angry[5];
99   int ppl_elvis;
100   int ppl_scientist;
101   int ppl_taxman;
102   int trade[4];
103   int trade_value[4];
104
105   /* the productions */
106   int food_prod;
107   int food_surplus;
108   int shield_prod;
109   int shield_surplus;
110   int trade_prod;
111   int corruption;
112   int tile_trade;
113   int shield_bonus;
114   int tax_bonus;
115   int science_bonus; /* more CPU savings! */
116
117   /* the totals */
118   int luxury_total;
119   int tax_total;
120   int science_total;
121
122   /* the physics */
123   int food_stock;
124   int shield_stock;
125   int pollution;
126   /* city can't be incited if INCITE_IMPOSSIBLE_COST */
127   int incite_revolt_cost;
128
129   bit is_building_unit; /* boolean unit/improvement */
130   reserved byte[3];
131   int currently_building;
132
133   byte improvements[200];
134   ceff_vector effects;
135
136   worklist worklist;
137
138   int city_map[5*5];
139
140   unit_list units_supported;
141   int steal; /* diplomats steal once; for spies, gets harder */
142   /* turn states */
143   int did_buy;
144   bit did_sell;
145   reserved byte[3];
146   bit is_updated;
147   reserved byte[3];
148   int turn_last_built; /* The last year in which something was built */
149   int turn_changed_target; /* Suffer shield loss at most once per turn */
150   int changed_from_id; /* If changed this turn, what changed from (id) */
151   bit changed_from_is_unit; /* If changed this turn, what changed from (unit?) */
152   reserved byte[3];
153   int disbanded_shields; /* If you disband unit in a city. Count them */
154   int caravan_shields; /* If caravan has helped city to build wonder. */
155   int before_change_shields; /* If changed this turn, shields before penalty */
156   int anarchy; /* anarchy rounds count */
157   int rapture; /* rapture rounds count */
158   bit was_happy;
159   reserved byte[3];
160   bit airlift;
161   reserved byte[3];
162   int original; /* original owner */
163   int city_options; /* bitfield; positions as enum city_options */
164
165   /* server variable. indicates if the city map is synced with the client. */
166   bit synced;
167   reserved byte[3];
168   /* info for dipl/spy investigation -- used only in client */
169   unit_list info_units_supported;
170   unit_list info_units_present;
171
172   /* ai_city ai; at end...don't need to actually have*/
173 }
174 civ_map *map;