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

kpublic.h

Go to the documentation of this file.
00001 /* Definitions of functions visible to interfaces in Xconq.
00002    Copyright (C) 1996-2000 Stanley T. Shebs.
00003 
00004 Xconq is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation; either version 2, or (at your option)
00007 any later version.  See the file COPYING.  */
00008 
00009 /* (should doublecheck that all of the decls in this file either have
00010    impls or are removed) */
00011 
00012 #undef  DEF_ACTION
00013 #define DEF_ACTION(name,code,args,prepfn,NETPREPFN,dofn,checkfn,ARGDECL,doc)  \
00014   extern int NETPREPFN ARGDECL;
00015 
00016 #include "action.def"
00017 
00018 #undef  DEF_TASK
00019 #define DEF_TASK(name,dname,code,argtypes,dofn,createfn,setfn,NETSETFN,pushfn,NETPUSHFN,ARGDECL)  \
00020   extern void NETSETFN ARGDECL;  \
00021   extern void NETPUSHFN ARGDECL;
00022 
00023 #include "task.def"
00024 
00025 /* Max number of packets received by each call to receive_data. */
00026 
00027 #define MAXPACKETS 32767
00028 
00029 /* File names below refer to locations of the kernel core functions. */
00030 
00031 /* ai.c */
00032 
00033 extern void net_set_side_ai(Side *side, char *aitype);
00034 
00035 /* module.c */
00036 
00037 extern void net_set_variant_value(int which, int v1, int v2, int v3);
00038 
00039 /* init.c */
00040 
00041 extern int net_add_side_and_player(void);
00042 extern int net_remove_side_and_player(int s);
00043 extern void net_set_player_advantage(int n, int newadv);
00044 extern void net_rename_side_for_player(int n, int which);
00045 extern void net_set_ai_for_player(int n, char *aitype);
00046 extern int net_exchange_players(int n, int n2);
00047 
00048 /* run2.c */
00049 
00050 extern void net_request_additional_side(char *playerspec);
00051 
00052 /* run.c */
00053 
00054 extern int net_run_game(int maxactions);
00055 extern void net_finish_turn(Side *side);
00056 extern void net_resign_game(Side *side, Side *side2);
00057 
00058 /* side.c */
00059 
00060 extern void net_set_side_name(Side *side, Side *side2, char *newname);
00061 extern void net_set_side_longname(Side *side, Side *side2, char *newname);
00062 extern void net_set_side_shortname(Side *side, Side *side2, char *newname);
00063 extern void net_set_side_noun(Side *side, Side *side2, char *newname);
00064 extern void net_set_side_pluralnoun(Side *side, Side *side2, char *newname);
00065 extern void net_set_side_adjective(Side *side, Side *side2, char *newname);
00066 extern void net_set_side_emblemname(Side *side, Side *side2, char *newname);
00067 extern void net_set_side_colorscheme(Side *side, Side *side2, char *newname);
00068 extern void net_become_designer(Side *side);
00069 extern void net_become_nondesigner(Side *side);
00070 extern void net_set_trust(Side *side, Side *side2, int val);
00071 extern void net_set_autofinish(Side *side, int value);
00072 extern void net_set_autoresearch(Side *side, int value);
00073 extern void net_set_willing_to_save(Side *side, int flag);
00074 extern void net_set_willing_to_draw(Side *side, int flag);
00075 extern void net_send_message(Side *side, SideMask sidemask, char *str);
00076 extern void net_set_side_self_unit(Side *side, struct a_unit *unit);
00077 extern void net_set_doctrine(Side *side, char *spec);
00078 extern void net_set_controlled_by(Side *side, Side *side2, int val);
00079 extern void net_set_side_research_topic(Side *side, int a);
00080 extern void net_set_side_research_goal(Side *side, int a);
00081 extern void net_set_side_startx(Side *side, int x);
00082 extern void net_set_side_starty(Side *side, int y);
00083 
00084 #ifdef DESIGNERS
00085 extern void net_paint_view(Side *side, int x, int y, int r, int tview, int uview);
00086 #endif /* DESIGNERS */
00087 
00088 /* plan.c */
00089 
00090 extern void net_set_unit_plan_type(Side *side, Unit *unit, int type);
00091 extern void net_set_unit_asleep(Side *side, Unit *unit, int flag, int recurse);
00092 extern void net_set_unit_reserve(Side *side, Unit *unit, int flag, int recurse);
00093 extern void net_set_unit_ai_control(Side *side, Unit *unit, int flag, int recurse);
00094 extern void net_set_unit_main_goal(Side *side, Unit *unit, Goal *goal);
00095 extern void net_set_unit_curadvance(Side *side, Unit *unit, int a);
00096 extern void net_set_unit_researchdone(Side *side, Unit *unit, int flag);
00097 extern void net_set_unit_waiting_for_transport(Side *side, Unit *unit, int flag);
00098 extern void net_wake_unit(Side *side, Unit *unit, int wakeocc);
00099 extern void net_wake_area(Side *side, int x, int y, int n, int occs);
00100 extern void net_set_formation(Unit *unit, Unit *leader, int x, int y, int dist, int flex);
00101 extern void net_delay_unit(Unit *unit, int flag);
00102 extern int net_clear_task_agenda(Side *side, Unit *unit);
00103 extern int net_clear_task_outcome(Side *side, Unit *unit);
00104 extern void net_force_replan(Unit *unit);
00105 
00106 /* unit.c */
00107 
00108 extern void net_set_unit_name(Side *side, Unit *unit, char *newname);
00109 extern int net_disband_unit(Side *side, Unit *unit);
00110 
00111 #ifdef DESIGNERS
00112 extern Unit *net_designer_create_unit(Side *side, int u, int s, int x, int y);
00113 extern int net_designer_teleport(Unit *unit, int x, int y, Unit *other);
00114 extern int net_designer_change_side(Unit *unit, Side *side);
00115 extern int net_designer_disband(Unit *unit);
00116 #endif /* DESIGNERS */
00117 
00118 /* task.c */
00119 
00120 extern void net_add_task(Unit *unit, int pos, Task *task);
00121 
00122 /* world.c */
00123 
00124 extern Feature *net_create_feature(char *feattype, char *name);
00125 extern void net_set_feature_type_name(Feature *feature, char *feattype);
00126 extern void net_set_feature_name(Feature *feature, char *name);
00127 extern void net_destroy_feature(Feature *feature);
00128 extern void net_renumber_features(void);
00129 
00130 #ifdef DESIGNERS
00131 extern void net_paint_cell(Side *side, int x, int y, int r, int t);
00132 extern void net_paint_border(Side *side, int x, int y, int dir, int t, int mode);
00133 extern void net_paint_connection(Side *side, int x, int y, int dir, int t, int mode);
00134 extern void net_paint_coating(Side *side, int x, int y, int r, int t, int depth);
00135 extern void net_paint_people(Side *side, int x, int y, int r, int s);
00136 extern void net_paint_control(Side *side, int x, int y, int r, int s);
00137 extern void net_paint_feature(Side *side, int x, int y, int r, int f);
00138 extern void net_paint_elevation(Side *side, int x, int y, int r, int code, int elev, int vary);
00139 extern void net_paint_temperature(Side *side, int x, int y, int r, int temp);
00140 extern void net_paint_material(Side *side, int x, int y, int r, int m, int amt);
00141 extern void net_paint_clouds(Side *side, int x, int y, int r, int cloudtype, int bot, int hgt);
00142 extern void net_paint_winds(Side *side, int x, int y, int r, int dir, int force);
00143 
00144                 /* should fix kernel separation! */
00145 
00146 extern void fix_elevations(void);
00147 
00148 #endif /* DESIGNERS */
00149 
00150 /* tp.c */
00151 
00152 extern void net_toggle_user_at(int u, int x, int y);
00153 
00154         /* called by all interfaces. */
00155 
00156 extern int send_join(char *str);
00157 extern void receive_data(int timeout, int lim);
00158 extern int host_the_game(char *hostport);
00159 extern int try_join_game(char *hostport);
00160 extern void net_save_game(char *fname);
00161 
00162         /* called by the unix interface. */
00163 
00164 extern void send_version(int rid);      
00165 extern void broadcast_game_module(void);
00166 extern void net_send_chat(int rid, char *str);
00167 extern int game_checksum(void);
00168 extern void send_quit(void);
00169 extern void flush_outgoing_queue(void);
00170 
00171 extern void (*update_variant_callback)(int which);
00172 extern void (*update_assignment_callback)(int n);
00173 
00174         /* called by cmdline.c. */
00175 
00176 extern void net_update_player(Player *player);
00177 
00178 
00179         /* called by the x11 interface. */
00180 
00181 extern void download_to_player(Player *player);
00182 
00183         /* Called by Tkconq. */
00184 
00185 extern void broadcast_randstate(void);
00186 
00187 /* Declarations of functions that must be supplied by an interface. */
00188 
00189 extern void add_remote_locally(int rid, char *str);
00190 extern void send_chat(int rid, char *str);
00191 extern void make_default_player_spec(void);

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