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

kernel.h File Reference

#include "action.def"
#include "task.def"

Include dependency graph for kernel.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  Xconq

Defines

#define DEF_ACTION(name, code, args, PREPFN, netprepfn, dofn, checkfn, ARGDECL, doc)   extern int PREPFN ARGDECL;
#define DEF_TASK(name, dname, code, argtypes, dofn, CREATEFN, SETFN, netsetfn, PUSHFN, netpushfn, ARGDECL)
#define type_consumes_from_treasury_directly(utype, side, m)
#define consumes_from_treasury_directly(unit, m)
#define type_produces_for_treasury_directly(utype, side, m)
#define produces_for_treasury_directly(unit, m)

Enumerations

enum  repairmode { NO_REPAIR, SELF_REPAIR, HP_RECOVERY, AUTO_REPAIR }
enum  WreckType {
  WRECK_TYPE_UNSPECIFIED = 0, WRECK_TYPE_KILLED, WRECK_TYPE_STARVED, WRECK_TYPE_ACCIDENT,
  WRECK_TYPE_ATTRITED, WRECK_TYPE_TERRAIN, WRECK_TYPE_SIDE_LOST
}

Functions

void rescue_occupants (Unit *unit)
void reckon_damage_around (int x, int y, int r, Unit *detonator)
void damage_unit (Unit *unit, enum damage_reasons reason, Unit *agent)
void capture_unit (Unit *unit, Unit *pris, int captype)
int detonate_unit (Unit *unit, int x, int y, int z)
void run_economy (void)
void run_all_consumption (void)
void set_player_advantage (int n, int newadv)
void rename_side_for_player (int n, int which)
void set_ai_for_player (int n, char *aitype)
int exchange_players (int n, int n2)
void set_edge_terrain (int doterr)
void set_variant_value (int which, int v1, int v2, int v3)
int move_unit (Unit *unit, int nx, int ny)
void change_control_side_around (int x, int y, int u, Side *side)
int has_enough_mp (Unit *unit, Unit *unit2, int mp)
int can_have_enough_mp (Unit *unit, Unit *unit2, int mp)
void set_unit_plan_type (Side *side, Unit *unit, int type)
void set_unit_asleep (Side *side, Unit *unit, int flag, int recurse)
void set_unit_reserve (Side *side, Unit *unit, int flag, int recurse)
void set_unit_ai_control (Side *side, Unit *unit, int flag, int recurse)
void set_unit_main_goal (Side *side, Unit *unit, Goal *goal)
void set_unit_curadvance (Side *side, Unit *unit, int a)
void set_unit_researchdone (Side *side, Unit *unit, int flag)
void set_unit_waiting_for_transport (Side *side, Unit *unit, int flag)
void wake_unit (Side *side, Unit *unit, int forcewakeoccs)
void selectively_wake_unit (Side *side, Unit *unit, int wakeoccs, int forcewakeoccs)
void wake_area (Side *side, int x, int y, int n, int occs)
void set_formation (Unit *unit, Unit *leader, int x, int y, int dist, int flex)
void delay_unit (Unit *unit, int flag)
int clear_task_agenda (Unit *unit)
void clear_task_outcome (Unit *unit)
void force_replan (Unit *unit)
int execute_plan (Unit *unit)
int is_in_formation (Unit *unit)
int move_into_formation (Unit *unit)
void free_plan (Unit *unit)
int execute_standing_order (Unit *unit, int addtask)
void set_waiting_for_tasks (Unit *unit, int flag)
void pop_task (Plan *plan)
Taskfind_unit_task_by_type (Unit *unit, TaskType tt)
void finish_turn (Side *side)
void resign_game (Side *side, Side *side2)
void change_people_side_around (int x, int y, int u, Side *side)
void maybe_starve (Unit *unit, int partial)
void request_additional_side (char *playerspec)
int total_acp_for_turn (Unit *unit)
void run_people (void)
void run_advanced_units (void)
void run_turn_start (void)
void run_restored_turn_start (void)
void run_turn_end (void)
void maybe_track (Unit *unit)
void maybe_lose_track (Unit *unit, int nx, int ny)
UnitViewadd_unit_view (Side *side, Unit *unit)
void add_unit_view_raw (Side *side, UnitView *uview, int x, int y)
void flush_stale_views (void)
void set_side_name (Side *side, Side *side2, char *newname)
void set_side_longname (Side *side, Side *side2, char *newname)
void set_side_shortname (Side *side, Side *side2, char *newname)
void set_side_noun (Side *side, Side *side2, char *newname)
void set_side_pluralnoun (Side *side, Side *side2, char *newname)
void set_side_adjective (Side *side, Side *side2, char *newname)
void set_side_emblemname (Side *side, Side *side2, char *newname)
void set_side_colorscheme (Side *side, Side *side2, char *newname)
void become_designer (Side *side)
void become_nondesigner (Side *side)
void set_trust (Side *side, Side *side2, int val)
void set_autofinish (Side *side, int value)
void set_autoresearch (Side *side, int value)
void set_willing_to_save (Side *side, int flag)
void set_willing_to_draw (Side *side, int flag)
void send_message (Side *side, SideMask sidemask, char *str)
void set_side_self_unit (Side *side, struct a_unit *unit)
void set_doctrine (Side *side, char *spec)
void set_controlled_by (Side *side, Side *side2, int val)
void set_side_research_topic (Side *side, int a)
void set_side_research_goal (Side *side, int a)
void set_side_startx (Side *side, int x)
void set_side_starty (Side *side, int y)
void init_tasks (void)
TaskOutcome execute_task (Unit *unit)
int target_visible (Unit *unit, Task *task)
int direct_access_to (int x, int y)
void resume_build_task (Unit *unit, Unit *unit2, int run, int x, int y)
void add_task (Unit *unit, int pos, Task *task)
Taskclone_task (Task *oldtask)
void sort_directions (Unit *unit, int *dirs, int numdirs)
void free_task (Task *task)
char * parse_task (Side *side, char *str, Task **taskp)
char * task_desig (Task *task)
int can_resupply_from_here (int x, int y)
int can_auto_resupply_self (Unit *unit, int *materials, int numtypes)
int can_repair_from_here (int x, int y)
void init_remote_ui (Side *side)
void add_remote_players (void)
void broadcast_start_game_load (void)
void broadcast_start_variant_setup (void)
void broadcast_variants_chosen (void)
void broadcast_start_player_setup (void)
void broadcast_players_assigned (void)
void add_to_packet (char *str)
void flush_write (void)
int can_be_actor (Unit *unit)
int change_cell (Unit *unit, int x, int y)
void wreck_unit (Unit *unit, HistEventType hevttype, WreckType wrecktype, int wreckarg, Unit *agent)
void change_unit_side (Unit *unit, Side *newside, int reason, Unit *agent)
void set_unit_side (Unit *unit, Side *side)
void set_unit_origside (Unit *unit, Side *side)
void set_unit_name (Side *side, Unit *unit, char *newname)
int disband_unit (Side *side, Unit *unit)
void kill_unit (Unit *unit, int reason)
void change_morale (Unit *unit, int sign, int morchange)
void init_units (void)
Unitcreate_bare_unit (int type)
Unitcreate_unit (int type, int makebrains)
void init_unit_actorstate (Unit *unit, int flagacp, int acp=0)
void init_unit_plan (Unit *unit)
void init_unit_tooling (Unit *unit)
void init_unit_opinions (Unit *unit, int nsides)
void init_unit_extras (Unit *unit)
void change_unit_type (Unit *unit, int newtype, int reason, Side *newside)
int enter_cell (Unit *unit, int x, int y)
void enter_transport (Unit *unit, Unit *transport)
void leave_cell (Unit *unit)
void leave_transport (Unit *unit)
void flush_dead_units (void)
void add_to_unit_hp (Unit *unit, int hp)
void fill_utype_array_from_lisp (int *typeary, Obj *typeobj)
void divide_into_regions (char *tlayer, TRegion **rlayer, int liquid)
Featurecreate_feature (char *feattype, char *name)
void set_feature_type_name (Feature *feature, char *feattype)
void set_feature_name (Feature *feature, char *name)
void destroy_feature (Feature *feature)
void renumber_features (void)
void toggle_user_at (Unit *unit, int x, int y)

Variables

int * lowm
int numlow
short any_auto_change_types


Detailed Description

This file contains declarations used by the kernel.

Todo:
Add to this when understood better.

Define Documentation

#define consumes_from_treasury_directly unit,
 ) 
 

Value:

(side_has_treasury((unit)->side, (m)) \
     && um_takes_from_treasury((unit)->type, (m)) \
     && (um_storage_x((unit)->type, (m)) <= 0))

#define DEF_ACTION name,
code,
args,
PREPFN,
netprepfn,
dofn,
checkfn,
ARGDECL,
doc   )     extern int PREPFN ARGDECL;
 

#define DEF_TASK name,
dname,
code,
argtypes,
dofn,
CREATEFN,
SETFN,
netsetfn,
PUSHFN,
netpushfn,
ARGDECL   ) 
 

Value:

extern void SETFN ARGDECL;  \
  extern void PUSHFN ARGDECL;

#define produces_for_treasury_directly unit,
 ) 
 

Value:

(side_has_treasury((unit)->side, (m)) \
    && um_gives_to_treasury((unit)->type, (m)) \
    && (um_storage_x((unit)->type, (m)) <= 0))

#define type_consumes_from_treasury_directly utype,
side,
 ) 
 

Value:

(side_has_treasury((side), (m)) && um_takes_from_treasury((utype), (m)) \
     && (um_storage_x((utype), (m)) <= 0))

#define type_produces_for_treasury_directly utype,
side,
 ) 
 

Value:

(side_has_treasury((side), (m)) && um_gives_to_treasury((utype), (m)) \
    && (um_storage_x((utype), (m)) <= 0))


Enumeration Type Documentation

enum repairmode
 

Enumeration values:
NO_REPAIR 
SELF_REPAIR 
HP_RECOVERY 
AUTO_REPAIR 

enum WreckType
 

Enumeration values:
WRECK_TYPE_UNSPECIFIED 
WRECK_TYPE_KILLED 
WRECK_TYPE_STARVED 
WRECK_TYPE_ACCIDENT 
WRECK_TYPE_ATTRITED 
WRECK_TYPE_TERRAIN 
WRECK_TYPE_SIDE_LOST 


Function Documentation

void add_remote_players void   ) 
 

void add_task Unit unit,
int  pos,
Task task
 

void add_to_packet char *  str  ) 
 

void add_to_unit_hp Unit unit,
int  hp
 

UnitView* add_unit_view Side side,
Unit unit
 

void add_unit_view_raw Side side,
UnitView uview,
int  x,
int  y
 

void become_designer Side side  ) 
 

void become_nondesigner Side side  ) 
 

void broadcast_players_assigned void   ) 
 

void broadcast_start_game_load void   ) 
 

void broadcast_start_player_setup void   ) 
 

void broadcast_start_variant_setup void   ) 
 

void broadcast_variants_chosen void   ) 
 

int can_auto_resupply_self Unit unit,
int *  materials,
int  numtypes
 

int can_be_actor Unit unit  ) 
 

int can_have_enough_mp Unit unit,
Unit unit2,
int  mp
 

int can_repair_from_here int  x,
int  y
 

int can_resupply_from_here int  x,
int  y
 

void capture_unit Unit unit,
Unit pris,
int  captype
 

int change_cell Unit unit,
int  x,
int  y
 

void change_control_side_around int  x,
int  y,
int  u,
Side side
 

void change_morale Unit unit,
int  sign,
int  morchange
 

void change_people_side_around int  x,
int  y,
int  u,
Side side
 

void change_unit_side Unit unit,
Side newside,
int  reason,
Unit agent
 

void change_unit_type Unit unit,
int  newtype,
int  reason,
Side newside
 

int clear_task_agenda Unit unit  ) 
 

void clear_task_outcome Unit unit  ) 
 

Task* clone_task Task oldtask  ) 
 

Unit* create_bare_unit int  type  ) 
 

Feature* create_feature char *  feattype,
char *  name
 

Unit* create_unit int  type,
int  makebrains
 

void damage_unit Unit unit,
enum damage_reasons  reason,
Unit agent
 

void delay_unit Unit unit,
int  flag
 

void destroy_feature Feature feature  ) 
 

int detonate_unit Unit unit,
int  x,
int  y,
int  z
 

int direct_access_to int  x,
int  y
 

int disband_unit Side side,
Unit unit
 

void divide_into_regions char *  tlayer,
TRegion **  rlayer,
int  liquid
 

int enter_cell Unit unit,
int  x,
int  y
 

void enter_transport Unit unit,
Unit transport
 

int exchange_players int  n,
int  n2
 

int execute_plan Unit unit  ) 
 

int execute_standing_order Unit unit,
int  addtask
 

TaskOutcome execute_task Unit unit  ) 
 

void fill_utype_array_from_lisp int *  typeary,
Obj typeobj
 

Task* find_unit_task_by_type Unit unit,
TaskType  tt
 

void finish_turn Side side  ) 
 

void flush_dead_units void   ) 
 

void flush_stale_views void   ) 
 

void flush_write void   ) 
 

void force_replan Unit unit  ) 
 

void free_plan Unit unit  ) 
 

void free_task Task task  ) 
 

int has_enough_mp Unit unit,
Unit unit2,
int  mp
 

void init_remote_ui Side side  ) 
 

void init_tasks void   ) 
 

void init_unit_actorstate Unit unit,
int  flagacp,
int  acp = 0
 

void init_unit_extras Unit unit  ) 
 

void init_unit_opinions Unit unit,
int  nsides
 

void init_unit_plan Unit unit  ) 
 

void init_unit_tooling Unit unit  ) 
 

void init_units void   ) 
 

int is_in_formation Unit unit  ) 
 

void kill_unit Unit unit,
int  reason
 

void leave_cell Unit unit  ) 
 

void leave_transport Unit unit  ) 
 

void maybe_lose_track Unit unit,
int  nx,
int  ny
 

void maybe_starve Unit unit,
int  partial
 

void maybe_track Unit unit  ) 
 

int move_into_formation Unit unit  ) 
 

int move_unit Unit unit,
int  nx,
int  ny
 

char* parse_task Side side,
char *  str,
Task **  taskp
 

void pop_task Plan plan  ) 
 

void reckon_damage_around int  x,
int  y,
int  r,
Unit detonator
 

void rename_side_for_player int  n,
int  which
 

void renumber_features void   ) 
 

void request_additional_side char *  playerspec  ) 
 

void rescue_occupants Unit unit  ) 
 

void resign_game Side side,
Side side2
 

void resume_build_task Unit unit,
Unit unit2,
int  run,
int  x,
int  y
 

void run_advanced_units void   ) 
 

void run_all_consumption void   ) 
 

void run_economy void   ) 
 

void run_people void   ) 
 

void run_restored_turn_start void   ) 
 

void run_turn_end void   ) 
 

void run_turn_start void   ) 
 

void selectively_wake_unit Side side,
Unit unit,
int  wakeoccs,
int  forcewakeoccs
 

void send_message Side side,
SideMask  sidemask,
char *  str
 

void set_ai_for_player int  n,
char *  aitype
 

void set_autofinish Side side,
int  value
 

void set_autoresearch Side side,
int  value
 

void set_controlled_by Side side,
Side side2,
int  val
 

void set_doctrine Side side,
char *  spec
 

void set_edge_terrain int  doterr  ) 
 

void set_feature_name Feature feature,
char *  name
 

void set_feature_type_name Feature feature,
char *  feattype
 

void set_formation Unit unit,
Unit leader,
int  x,
int  y,
int  dist,
int  flex
 

void set_player_advantage int  n,
int  newadv
 

void set_side_adjective Side side,
Side side2,
char *  newname
 

void set_side_colorscheme Side side,
Side side2,
char *  newname
 

void set_side_emblemname Side side,
Side side2,
char *  newname
 

void set_side_longname Side side,
Side side2,
char *  newname
 

void set_side_name Side side,
Side side2,
char *  newname
 

void set_side_noun Side side,
Side side2,
char *  newname
 

void set_side_pluralnoun Side side,
Side side2,
char *  newname
 

void set_side_research_goal Side side,
int  a
 

void set_side_research_topic Side side,
int  a
 

void set_side_self_unit Side side,
struct a_unit unit
 

void set_side_shortname Side side,
Side side2,
char *  newname
 

void set_side_startx Side side,
int  x
 

void set_side_starty Side side,
int  y
 

void set_trust Side side,
Side side2,
int  val
 

void set_unit_ai_control Side side,
Unit unit,
int  flag,
int  recurse
 

void set_unit_asleep Side side,
Unit unit,
int  flag,
int  recurse
 

void set_unit_curadvance Side side,
Unit unit,
int  a
 

void set_unit_main_goal Side side,
Unit unit,
Goal goal
 

void set_unit_name Side side,
Unit unit,
char *  newname
 

void set_unit_origside Unit unit,
Side side
 

void set_unit_plan_type Side side,
Unit unit,
int  type
 

void set_unit_researchdone Side side,
Unit unit,
int  flag
 

void set_unit_reserve Side side,
Unit unit,
int  flag,
int  recurse
 

void set_unit_side Unit unit,
Side side
 

void set_unit_waiting_for_transport Side side,
Unit unit,
int  flag
 

void set_variant_value int  which,
int  v1,
int  v2,
int  v3
 

void set_waiting_for_tasks Unit unit,
int  flag
 

void set_willing_to_draw Side side,
int  flag
 

void set_willing_to_save Side side,
int  flag
 

void sort_directions Unit unit,
int *  dirs,
int  numdirs
 

int target_visible Unit unit,
Task task
 

char* task_desig Task task  ) 
 

void toggle_user_at Unit unit,
int  x,
int  y
 

int total_acp_for_turn Unit unit  ) 
 

void wake_area Side side,
int  x,
int  y,
int  n,
int  occs
 

void wake_unit Side side,
Unit unit,
int  forcewakeoccs
 

void wreck_unit Unit unit,
HistEventType  hevttype,
WreckType  wrecktype,
int  wreckarg,
Unit agent
 


Variable Documentation

short any_auto_change_types
 

int* lowm
 

int numlow
 


Generated on Sat Sep 17 10:29:16 2005 for XconqKernel by doxygen 1.3.6