Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

side.h

Go to the documentation of this file.
00001 /* Definitions for sides in Xconq.
00002    Copyright (C) 1987-1989, 1991-1997, 1999-2000 Stanley T. Shebs.
00003    Copyright (C) 2004 Eric A. McDonald.
00004 
00005 Xconq is free software; you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation; either version 2, or (at your option)
00008 any later version.  See the file COPYING.  */
00009 
00022 #include "parambox.h"
00023 
00024 #if MAXSIDES < 31
00025 
00031 typedef int SideMask;
00033 #define NOSIDES (0)
00034 
00035 #define ALLSIDES (-1)
00036 
00044 #define add_side_to_set(side,mask) ((mask) | (1 << ((side) ? (side)->id : 0)))
00045 
00054 #define remove_side_from_set(side,mask) \
00055   ((mask) & ~(1 << ((side) ? (side)->id : 0)))
00056 
00064 #define side_in_set(side,mask) ((mask) & (1 << ((side) ? (side)->id : 0)))
00065 #else
00066 not implemented yet
00067 #endif /* MAXSIDES */
00068 
00074 typedef struct a_doctrine {
00075     short id;                   
00076     char *name;                 
00077     short resupply_percent;     
00078     short rearm_percent;        
00079     short repair_percent;       
00080     short resupply_complete;    
00081     short rearm_complete;       
00082     short repair_complete;      
00083     short min_turns_food;       
00085     short min_distance_fuel;    
00087     short *construction_run;    
00088     short locked;               
00089     struct a_doctrine *next;    
00090 } Doctrine;
00091 
00096 enum sordercond {
00097     sorder_always,      
00098     sorder_at,          
00099     sorder_in,          
00100     sorder_near         
00101 };
00102 
00108 typedef struct a_standing_order {
00109     char *types;                
00110     enum sordercond condtype;   
00111     int a1;                     
00112     int a2;                     
00113     int a3;                     
00114     struct a_task *task;        
00115     struct a_standing_order *next;      
00117 } StandingOrder;
00118 
00119 namespace Xconq {
00120     namespace AI {
00121         struct AI_Side;
00122     }
00123 }
00124 typedef Xconq::AI::AI_Side AI_Side;
00125 
00133 typedef struct a_side {
00134     int id;                     
00135     Obj *symbol;                
00136     char *name;                 
00139     char *longname;             
00143     char *shortname;            
00146     char *noun;                 
00151     char *pluralnoun;           
00158     char *adjective;            
00166     char *colorscheme;          
00169     char *default_color;        
00172     char *emblemname;           
00178     char **unitnamers;          
00183     Obj *featurenamers;         
00186     short nameslocked;          
00188     char *sideclass;            
00192     struct a_unit *self_unit;   
00198     short self_unit_id;         
00199     struct a_side *controlled_by;       
00201     short controlled_by_id;     
00203     SideMask knows_about;       
00205     short *trusts;              
00207     short *trades;              
00209     short *startwith;           
00211     short *counts;              
00213     short *tech;                
00215     short *inittech;            
00217     short *action_priorities;   
00219     short *already_seen;        
00221     short *already_seen_indep;  
00223     Doctrine *default_doctrine; 
00225     Doctrine **udoctrine;       
00227     short doctrines_locked;     
00229     StandingOrder *orders;      
00232     StandingOrder *last_order;  
00235     char *uorders;              
00237     Obj *possible_units;        
00239     short ai_may_resign;        
00241     short *advance;             
00244     short research_topic;       
00246     short autoresearch;         
00248     short research_goal;        
00249     long *treasury;             
00251     short *c_rates;             
00253     char *terrview;             
00254     char **auxterrview;         
00255     short *terrviewdate;        
00257     short **auxterrviewdate;    
00259     struct a_unit_view **unit_views;    
00261     short **materialview;       
00262     short **materialviewdate;   
00264     short *tempview;            
00265     short *tempviewdate;        
00267     short *cloudview;           
00268     short *cloudbottomview;     
00269     short *cloudheightview;     
00270     short *cloudviewdate;       
00272     short *windview;            
00273     short *windviewdate;        
00274     short ingame;               
00276     short everingame;           
00278     short priority;             
00280     short status;               
00281     short *scores;              
00283     Obj *rawscores;             
00285     short willingtodraw;        
00287     short autofinish;           
00289     short finishedturn;         
00291     short turntimeused;         
00292     short totaltimeused;        
00293     short timeouts;             
00294     short timeoutsused;         
00295     short curactor_pos;         
00297     struct a_unit *curactor;    
00299     short curactor_id;          
00300     short advantage;            
00301     short minadvantage;         
00303     short maxadvantage;         
00304     short init_center_x;        
00306     short init_center_y;        
00308     Obj *instructions;          
00310     short last_notice_date;     
00311     short realtimeout;          
00312     long startbeeptime;         
00314     short *gaincounts;          
00316     short *losscounts;          
00317     long **atkstats;            
00318     long **hitstats;            
00319     struct a_player *player;    
00320     short playerid;             
00321     struct a_ui *ui;            
00322     Obj *uidata;                
00323     short aitype;               
00324     struct a_ai *ai;            
00325     Obj *aidata;                
00326     struct a_rui *rui;          
00327     struct a_rai *rai;          
00328 
00329     AI_Side *master_ai;
00330     short startx, starty;       
00331     short busy;                 
00332     short finalradius;          
00333     short willingtosave;        
00335     short see_all;              
00339     short show_all;             
00343     short may_set_show_all;     
00347     short unit_view_restored;   
00348 #ifdef DESIGNERS
00349     short designer;             
00350 #endif /* DESIGNERS */
00351     short *uavail;              
00353     short *canbuild;            
00355     short *candevelop;          
00357     short *cancarry;            
00359     short *canresearch;         
00361     short *research_precluded;  
00365 
00366     short *could_act_with;
00368     short *could_construct;
00370     short *could_develop;
00372     short *could_research;
00373     struct a_unit *unithead;    
00374     struct a_unitvector *actionvector;  
00375     short numwaiting;           
00376     short *coverage;            
00377     short *alt_coverage;        
00378     short *numunits;            
00379     short numacting;            
00380     short numfinished;          
00382     long turnstarttime;         
00383     long lasttime;              
00384     long turnfinishtime;        
00386     long laststarttime;         
00387     int point_value_cache;      
00388     int point_value_valid;      
00389     int prefixarg;              
00390     struct a_side *next;        
00391 } Side;
00392 
00393 /* Side parameter box. */
00394 struct ParamBoxSide : public ParamBox {
00395     Side *side;
00396     ParamBoxSide() { pboxtype = PBOX_TYPE_SIDE; side = NULL; }
00397 };
00398 
00399 /* Some convenient macros. */
00400 
00406 #define side_in_play(side) (side->ingame)
00407 
00408 /* Iteration over all sides. */
00409 
00416 #define for_all_real_sides(v)  \
00417   for (v = (sidelist ? sidelist->next : NULL); v != NULL; v = v->next)
00418 
00425 #define for_all_sides(v)  \
00426   for (v = sidelist; v != NULL; v = v->next)
00427 
00428 /* Macros for accessing and setting a side's view data.  In general,
00429    interfaces should go through these macros instead of accessing the
00430    world's state directly. */
00431 
00442 #define terrain_view(s,x,y)  \
00443   ((s)->terrview ? aref((s)->terrview, x, y) : buildtview(terrain_at(x, y)))
00444 
00456 #define set_terrain_view(s,x,y,v)  \
00457   ((s)->terrview ? aset((s)->terrview, x, y, v) : 0)
00458 
00466 #define buildtview(t) ((t) + 1)
00467 
00475 #define vterrain(v) ((v) - 1)
00476 
00478 #define UNSEEN (0)
00479 
00492 #define terrain_view_date(s,x,y)  \
00493   ((s)->terrviewdate ? aref((s)->terrviewdate, x, y) : 0)
00494 
00508 #define set_terrain_view_date(s,x,y,v)  \
00509   ((s)->terrviewdate ? aset((s)->terrviewdate, x, y, v) : 0)
00510 
00527 #define aux_terrain_view(s,x,y,t)  \
00528   (((s)->auxterrview && (s)->auxterrview[t]) ? \
00529         aref((s)->auxterrview[t], x, y) : \
00530         (aux_terrain_defined(t) ? aux_terrain_at(x, y, t) : 0))
00531 
00546 #define set_aux_terrain_view(s,x,y,t,v)  \
00547   (((s)->auxterrview && (s)->auxterrview[t]) ? aset((s)->auxterrview[t], x, y, v) : 0)
00548 
00565 #define aux_terrain_view_date(s,x,y,t)  \
00566   (((s)->auxterrviewdate && (s)->auxterrviewdate[t]) ? aref((s)->auxterrviewdate[t], x, y) : 0)
00567 
00582 #define set_aux_terrain_view_date(s,x,y,t,v)  \
00583   (((s)->auxterrviewdate && (s)->auxterrviewdate[t]) ? aset((s)->auxterrviewdate[t], x, y, v) : 0)
00584 
00590 #define for_all_unit_views(v)  \
00591     for (v = viewlist; v != NULL; v = v->vnext)
00592 
00601 #define nextview(s,x,y,uv) \
00602         ((uv)->transport == NULL ? unit_view_next((s), (x), (y), (uv)) : (uv)->nexthere)
00603 
00613 #define for_all_view_stack(s,x,y,uv) \
00614   for ((uv) = unit_view_at(s,x,y); (uv) != NULL; (uv) = unit_view_next(s,x,y,uv))
00615 
00616 /* Iterate over all uviews in a given uvstack. */
00617 #define for_all_uvstack(uvs,uv) \
00618     for ((uv) = (uvs); (uv); \
00619          (uv) = unit_view_next((uvs)->observer == -1 \
00620                                 ? NULL : side_n((uvs)->observer), \
00621                                (uvs)->x, (uvs)->y, (uv)))
00622 
00634 #define for_all_view_stack_with_occs(s, x,y,uv)  \
00635   for ((uv) = unit_view_at((s), (x), (y)); \
00636           (uv) != NULL; \
00637          (uv) = ((uv)->occupant != NULL ? \
00638                         (uv)->occupant : \
00639                       (nextview((s), (x), (y), (uv)) != NULL ? \
00640                         nextview((s), (x), (y), (uv)) : \
00641                       ((uv)->transport != NULL && \
00642                         nextview((s), (x), (y), (uv)->transport) != NULL ? \
00643                         nextview((s), (x), (y), (uv)->transport) : \
00644                       ((uv)->transport != NULL && \
00645                         (uv)->transport->transport != NULL && \
00646                         nextview((s), (x), (y), (uv)->transport->transport) != NULL ? \
00647                         nextview((s), (x), (y), (uv)->transport->transport) : \
00648                       ((uv)->transport != NULL && \
00649                         (uv)->transport->transport != NULL && \
00650                         (uv)->transport->transport->transport != NULL && \
00651                         nextview((s), (x), (y), (uv)->transport->transport->transport) != NULL ? \
00652                         nextview((s), (x), (y), (uv)->transport->transport->transport) : NULL))))))
00653 
00660 #define for_all_occupant_views(uv,v) \
00661   for (v = (uv)->occupant; v != NULL; v = v->nexthere)
00662 
00674 #define for_all_occupant_views_with_occs(uv,var)  \
00675   for ((var) = (uv)->occupant; \
00676        (var) != NULL && (var) != (uv)->nexthere; \
00677          (var) = ((var)->occupant != NULL ? \
00678                         (var)->occupant : \
00679                       ((var)->nexthere != NULL ? \
00680                         (var)->nexthere : \
00681                       ((var)->transport != NULL && \
00682                         (var)->transport->nexthere != NULL ? \
00683                         (var)->transport->nexthere : \
00684                       ((var)->transport != NULL && \
00685                         (var)->transport->transport != NULL && \
00686                         (var)->transport->transport->nexthere != NULL ? \
00687                         (var)->transport->transport->nexthere : NULL)))))
00688 
00689 /* Get a pointer to the actual unit being viewed if possible. */
00690 
00701 #define view_unit(uv) \
00702   (((uv)->unit != NULL && (uv)->id == (uv)->unit->id) ? (uv)->unit : NULL)
00703 
00704 /* Manipulation of view of cell materials. */
00705 
00716 #define material_view(s,x,y,m)  \
00717   (((s)->materialview && (s)->materialview[m]) ? aref((s)->materialview[m], x, y) : (cell_material_defined(m) ? material_at(x, y, m) : 0))
00718 
00730 #define set_material_view(s,x,y,m,v)  \
00731   (((s)->materialview && (s)->materialview[m]) ? aset((s)->materialview[m], x, y, v) : 0)
00732 
00743 #define material_view_date(s,x,y,m)  \
00744   (((s)->materialviewdate && (s)->materialviewdate[m]) ? aref((s)->materialviewdate[m], x, y) : 0)
00745 
00757 #define set_material_view_date(s,x,y,m,v)  \
00758   (((s)->materialviewdate && (s)->materialviewdate[m]) ? aset((s)->materialviewdate[m], x, y, v) : 0)
00759 
00760 /* Manipulation of view of weather. */
00761 
00771 #define temperature_view(s,x,y)  \
00772   ((s)->tempview ? aref((s)->tempview, x, y) : (temperatures_defined() ? temperature_at(x, y) : 0))
00773 
00784 #define set_temperature_view(s,x,y,v)  \
00785   ((s)->tempview ? aset((s)->tempview, x, y, v) : 0)
00786 
00796 #define temperature_view_date(s,x,y)  \
00797   ((s)->tempviewdate ? aref((s)->tempviewdate, x, y) : 0)
00798 
00809 #define set_temperature_view_date(s,x,y,v)  \
00810   ((s)->tempviewdate ? aset((s)->tempviewdate, x, y, v) : 0)
00811 
00821 #define cloud_view(s,x,y)  \
00822   ((s)->cloudview ? aref((s)->cloudview, x, y) : (clouds_defined() ? raw_cloud_at(x, y) : 0))
00823 
00834 #define set_cloud_view(s,x,y,v)  \
00835   ((s)->cloudview ? aset((s)->cloudview, x, y, v) : 0)
00836 
00846 #define cloud_view_date(s,x,y)  \
00847   ((s)->cloudviewdate ? aref((s)->cloudviewdate, x, y) : 0)
00848 
00859 #define set_cloud_view_date(s,x,y,v)  \
00860   ((s)->cloudviewdate ? aset((s)->cloudviewdate, x, y, v) : 0)
00861 
00871 #define cloud_bottom_view(s,x,y)  \
00872   ((s)->cloudbottomview ? aref((s)->cloudbottomview, x, y) : (cloud_bottoms_defined() ? raw_cloud_bottom_at(x, y) : 0))
00873 
00884 #define set_cloud_bottom_view(s,x,y,v)  \
00885   ((s)->cloudbottomview ? aset((s)->cloudbottomview, x, y, v) : 0)
00886 
00896 #define cloud_bottom_view_date(s,x,y)  \
00897   ((s)->cloudbottomviewdate ? aref((s)->cloudbottomviewdate, x, y) : 0)
00898 
00909 #define set_cloud_bottom_view_date(s,x,y,v)  \
00910   ((s)->cloudbottomviewdate ? aset((s)->cloudbottomviewdate, x, y, v) : 0)
00911 
00921 #define cloud_height_view(s,x,y)  \
00922   ((s)->cloudheightview ? aref((s)->cloudheightview, x, y) : (cloud_heights_defined() ? raw_cloud_height_at(x, y) : 0))
00923 
00934 #define set_cloud_height_view(s,x,y,v)  \
00935   ((s)->cloudheightview ? aset((s)->cloudheightview, x, y, v) : 0)
00936 
00946 #define cloud_height_view_date(s,x,y)  \
00947   ((s)->cloudheightviewdate ? aref((s)->cloudheightviewdate, x, y) : 0)
00948 
00959 #define set_cloud_height_view_date(s,x,y,v)  \
00960   ((s)->cloudheightviewdate ? aset((s)->cloudheightviewdate, x, y, v) : 0)
00961 
00971 #define wind_view(s,x,y)  \
00972   ((s)->windview ? aref((s)->windview, x, y) : (winds_defined() ? raw_wind_at(x, y) : CALM))
00973 
00984 #define set_wind_view(s,x,y,v)  \
00985   ((s)->windview ? aset((s)->windview, x, y, v) : 0)
00986 
00996 #define wind_view_date(s,x,y)  \
00997   ((s)->windviewdate ? aref((s)->windviewdate, x, y) : 0)
00998 
01009 #define set_wind_view_date(s,x,y,v)  \
01010   ((s)->windviewdate ? aset((s)->windviewdate, x, y, v) : 0)
01011 
01012 /* Basic manipulation of vision coverage cache layer. */
01013 
01023 #define cover(s,x,y)  \
01024   ((s)->coverage ? aref((s)->coverage, x, y) : 0)
01025 
01036 #define set_cover(s,x,y,v)  \
01037   ((s)->coverage ? aset((s)->coverage, x, y, v) : 0)
01038 
01049 #define add_cover(s,x,y,v)  \
01050   ((s)->coverage ? aadd((s)->coverage, (x), (y), (v)) : 0)
01051 
01061 #define alt_cover(s,x,y)  \
01062   ((s)->alt_coverage ? aref((s)->alt_coverage, x, y) : 0)
01063 
01074 #define set_alt_cover(s,x,y,v)  \
01075   ((s)->alt_coverage ? aset((s)->alt_coverage, x, y, v) : 0)
01076 
01084 #define side_has_treasury(s,m) (s != indepside ? m_treasury(m) : g_indepside_has_treasury() ? m_treasury(m) : FALSE) 
01085 
01086 /* Tests of who/what runs the side. */
01087 
01094 #define side_wants_display(s) ((s)->player && (s)->player->displayname)
01095 
01103 #define side_wants_ai(s) ((s)->player && (s)->player->aitypename)
01104 
01112 #define side_has_display(s) (((s)->ui) != NULL || ((s)->rui) != NULL)
01113 
01120 #define side_has_local_display(s) ((s)->ui != NULL)
01121 
01129 #define side_has_ai(s) (((s)->ai) != NULL || ((s)->rai) != NULL)
01130 
01137 #define side_has_local_ai(s) ((s)->ai != NULL)
01138 
01139 /* Tests of side state. */
01140 
01147 #define side_lost(s) ((s) != NULL && !(s)->ingame && (s)->status < 0)
01148 
01155 #define side_drew(s) ((s) != NULL && !(s)->ingame && (s)->status == 0)
01156 
01163 #define side_won(s) ((s) != NULL && !(s)->ingame && (s)->status > 0)
01164 
01165 #define side_gain_count(s,u,r) (((s)->gaincounts)[num_gain_reasons*(u)+(r)])
01166 
01167 #define side_loss_count(s,u,r) (((s)->losscounts)[num_loss_reasons*(u)+(r)])
01168 
01169 #define side_atkstats(s,a,d) ((s)->atkstats[a] ? ((s)->atkstats[a])[d] : 0)
01170 
01171 #define side_hitstats(s,a,d) ((s)->hitstats[a] ? ((s)->hitstats[a])[d] : 0)
01172 
01182 #define terrain_visible(side, x, y)  \
01183   ((side)->see_all || (terrain_view((side), (x), (y)) != UNSEEN))
01184 
01195 #define borders_visible(side, x, y, d)  \
01196   ((side)->see_all || seen_border((side), (x), (y), (d)))
01197 
01206 #define units_visible(side, x, y)  \
01207   ((side)->see_all || (cover((side), (x), (y)) >= 1))
01208 
01216 #define has_advance(side,a) ((side)->advance[(a)] == DONE)
01217 
01218 /* Return true if a side's units can build the given type. */
01219 
01227 #define side_can_build(side,u)  \
01228   ((side)->canbuild != NULL ? (side)->canbuild[u] : TRUE)
01229 
01230 /* Return true if a side's units can carry the given type. */
01231 
01239 #define side_can_carry(side,u)  \
01240   ((side)->cancarry != NULL ? (side)->cancarry[u] : TRUE)
01241 
01242 /* Return true if a side's units can develop the given type. */
01243 
01251 #define side_can_develop(side,u)  \
01252   ((side)->candevelop != NULL ? (side)->candevelop[u] : TRUE)
01253 
01254 /* Return true if a side can research the given type. */
01255 
01263 #define side_can_research(side,a)  \
01264   ((side)->canresearch != NULL ? (side)->canresearch[a] : TRUE)
01265 
01274 #define inactive_indepside(side)  \
01275   ((side) == indepside && !side_has_ai(side) && !side_has_display(side))
01276 
01277 #ifdef DESIGNERS
01278 #define is_designer(side) (side->designer)
01279 #else /* DESIGNERS */
01280 #define is_designer(side) (FALSE)
01281 #endif /* DESIGNERS */
01282 
01283 #define for_all_doctrines(d)  \
01284   for ((d) = doctrine_list; (d) != NULL; (d) = (d)->next)
01285 
01286 /* Side-related variables. */
01287 
01289 extern Side *sidelist;
01291 extern Side *lastside;
01293 extern Side *indepside;
01295 extern Side *curside;
01297 extern Side *tmpside;
01298 
01300 extern int numsides;
01302 extern int numtotsides;
01304 extern int numplayers;
01305 #ifdef DESIGNERS
01306 
01307 extern int numdesigners;
01308 #endif /* DESIGNERS */
01309 
01310 #if 0
01311 
01315 typedef struct a_agreement {
01316     short id;                                   
01317     char *agtype;                       
01318     char *name;                         
01319     int state;                                  
01320     SideMask drafters;                  
01321     SideMask proposers;                 
01322     SideMask signers;                   
01323     SideMask willing;                   
01324     SideMask knownto;                   
01325     struct a_obj *terms;                
01326     short enforcement;                  
01327     struct a_agreement *next;   
01328 } Agreement;
01329 
01334 enum {
01335     draft,              
01336     proposed,           
01337     in_force,           
01338     moribund    
01339 };
01340 
01341 /* Iteration over all agreements in the game. */
01342 
01348 #define for_all_agreements(v) for (v = agreement_list; v != NULL; v = v->next)
01349 
01355 #define any_agreements() (agreement_list != NULL)
01356 
01363 #define side_signed_agreement(side,ag) ((ag)->signers[side_n(side)])
01364 
01365 #define side_willing_agreement(side,ag) ((ag)->willing[side_n(side)])
01366 
01374 #define side_knows_about_agreement(side,ag) ((ag)->knownto[side_n(side)])
01375 
01376 /* Agreement-related variables. */
01377 
01379 extern int num_agreements;
01380 
01382 extern Agreement *agreement_list;
01384 extern Agreement *last_agreement;
01385 
01386 #endif
01387 
01388 /* Note: Can't use the "Unit" typedef below, must use "struct a_unit". */
01389 
01390 extern int n_units_on_side(Side *side);
01391 
01392 extern void init_sides(void);
01393 extern Side *create_side(void);
01394 extern void init_side_unithead(Side *side);
01395 extern int side_has_units(Side *side);
01396 extern void init_doctrine(Side *side);
01397 extern void init_self_unit(Side *side);
01398 extern int init_view(Side *side);
01399 extern void calc_start_xy(Side *side);
01400 extern char *side_name(Side *side);
01401 extern char *side_adjective(Side *side);
01402 extern int side_number(Side *side);
01403 extern Side *side_n(int n);
01404 extern Side *find_side_by_name(char *str);
01405 extern int side_controls_side(Side *side, Side *side2);
01406 extern int side_controls_unit(Side *side, struct a_unit *unit);
01407 extern int side_sees_unit(Side *side, struct a_unit *unit);
01408 extern int side_sees_image(Side *side, struct a_unit *unit);
01409 extern int occupants_visible(Side *side, struct a_unit *unit);
01410 extern int num_units_in_play(Side *side, int u);
01411 extern int num_units_incomplete(Side *side, int u);
01412 extern struct a_unit *find_next_unit(Side *side, struct a_unit *prevunit);
01413 extern struct a_unit *find_prev_unit(Side *side, struct a_unit *nextunit);
01414 extern struct a_unit *find_next_actor(Side *side, struct a_unit *prevunit);
01415 extern struct a_unit *find_prev_actor(Side *side, struct a_unit *nextunit);
01416 extern struct a_unit *find_next_mover(Side *side, struct a_unit *prevunit);
01417 extern struct a_unit *find_prev_mover(Side *side, struct a_unit *nextunit);
01418 extern struct a_unit *find_next_awake_mover(Side *side,
01419                                             struct a_unit *prevunit);
01420 extern struct a_unit *find_prev_awake_mover(Side *side,
01421                                             struct a_unit *nextunit);
01422 extern int side_initacp(Side *side);
01423 extern int side_acp(Side *side);
01424 extern int side_acp_reserved(Side *side);
01425 extern int using_tech_levels(void);
01426 extern void remove_side_from_game(Side *side);
01427 extern int num_displayed_sides(void);
01428 extern int trusted_side(Side *side1, Side *side2);
01429 extern int enemy_side(Side *s1, Side *s2);
01430 extern int allied_side(Side *s1, Side *s2);
01431 extern int neutral_side(Side *s1, Side *s2);
01432 extern void reveal_side(Side *sender, Side *recipient, int *types);
01433 extern void receive_message(Side *side, Side *sender, char *str);
01434 extern struct a_unit_view *unit_view_at(Side *side, int x, int y);
01435 extern struct a_unit_view *unit_view_next(Side *side, int x, int y,
01436                                           struct a_unit_view *uview);
01437 extern struct a_unit *query_unit_from_uview(struct a_unit_view *uview);
01438 extern struct a_unit_view *query_uvstack_from_unit(struct a_unit *unit);
01439 extern struct a_unit_view *query_uvstack_at(int x, int y);
01440 extern void all_see_occupy(struct a_unit *unit, int x, int y, int inopen);
01441 extern void all_see_leave(struct a_unit *unit, int x, int y, int inopen);
01442 extern void cover_area(Side *side, struct a_unit *unit,
01443                        struct a_unit *oldtransport, int x0, int y0,
01444                        int x1, int y1);
01445 extern void reset_coverage(void);
01446 extern void really_reset_coverage(void);
01447 extern void calc_coverage(Side *side);
01448 extern void reset_all_views(void);
01449 extern void reset_view(Side *side);
01450 extern void react_to_seen_unit(Side *side, struct a_unit *unit, int x, int y);
01451 extern void all_see_cell(int x, int y);
01452 extern int see_cell(Side *side, int x, int y);
01453 extern void see_exact(Side *side, int x, int y);
01454 extern int seen_border(Side *side, int x, int y, int dir);
01455 extern void maybe_track(struct a_unit *unit);
01456 extern void maybe_lose_track(struct a_unit *unit, int nx, int ny);
01457 extern char *side_desig(Side *side);
01458 
01459 extern Side *parse_side_spec(char *str);
01460 
01461 extern int actual_advantage(Side *side);
01462 
01463 extern Doctrine *new_doctrine(int id);
01464 extern Doctrine *find_doctrine(int id);
01465 extern Doctrine *find_doctrine_by_name(char *name);
01466 extern Doctrine *clone_doctrine(Doctrine *doctrine);
01467 extern void set_doctrine(Side *side, char *spec);
01468 
01469 extern StandingOrder *new_standing_order(void);
01470 extern void add_standing_order(Side *side, StandingOrder *sorder, int pos);
01471 extern int parse_standing_order(Side *side, char *cmdstr);
01472 extern char *parse_unit_types(Side *side, char *str, char *utypevec);
01473 extern char *parse_order_cond(Side *side, char *str, StandingOrder *sorder);
01474 extern char *get_next_arg(char *str, char *buf, char **rsltp);
01475 extern char *standing_order_desc(StandingOrder *sorder, char *buf);
01476 #if 0
01477 extern void init_agreements(void);
01478 extern Agreement *create_agreement(int id);
01479 extern Agreement *find_agreement(int id);
01480 extern char *agreement_desig(Agreement *ag);
01481 #endif
01482 extern void fn_set_terrain_view(int x, int y, int val);
01483 extern void fn_set_aux_terrain_view(int x, int y, int val);
01484 extern void fn_set_terrain_view_date(int x, int y, int val);
01485 extern void fn_set_aux_terrain_view_date(int x, int y, int val);
01486 extern void fn_set_material_view(int x, int y, int val);
01487 extern void fn_set_material_view_date(int x, int y, int val);
01488 extern void fn_set_temp_view(int x, int y, int val);
01489 extern void fn_set_temp_view_date(int x, int y, int val);
01490 extern void fn_set_cloud_view(int x, int y, int val);
01491 extern void fn_set_cloud_bottom_view(int x, int y, int val);
01492 extern void fn_set_cloud_height_view(int x, int y, int val);
01493 extern void fn_set_cloud_view_date(int x, int y, int val);
01494 extern void fn_set_wind_view(int x, int y, int val);
01495 extern void fn_set_wind_view_date(int x, int y, int val);
01496 
01497 extern int load_side_config(Side *side);
01498 
01499 extern void update_side_display_all_sides(Side *side, int rightnow);
01500 
01501 extern int side_material_supply(Side * side, int m);
01502 extern int side_material_production(Side * side, int m);
01503 extern int side_material_storage(Side * side, int m);
01504 
01505 extern int fn_test_side_in_sideclass(Obj *osclass, ParamBox *pbox);
01506 

Generated on Sat Sep 17 10:28:53 2005 for XconqKernel by doxygen 1.3.6