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

unit.h File Reference

Definitions relating to units in Xconq. More...

#include "parambox.h"
#include "action.def"
#include "goal.def"
#include "task.def"
#include "plan.def"

Include dependency graph for unit.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.

Classes

struct  a_unit
 Unit. More...

struct  a_unit_extras
 Unit exta options. More...

struct  a_unit_view
 Unit View. More...

struct  ParamBoxUnit
struct  ParamBoxUnitAt
struct  ParamBoxUnitUnit
struct  ParamBoxUnitSide
struct  a_seer_node
struct  ParamBoxUnitSideSeers
struct  ParamBoxUnitUnitSeers
struct  a_unitvectorentry
struct  a_unitvector
struct  a_actiondefn
 Action definition. More...

struct  a_action
 Action. More...

struct  a_actorstate
struct  a_goaldefn
 Goal definition. More...

struct  a_goal
 Goal. More...

struct  a_task
 Task. More...

struct  a_taskdefn
 Task definition. More...

struct  a_plan
 Plan. More...


Defines

#define for_all_units(v)   for (v = unitlist; v != NULL; v = v->unext)
 Iteration over all units.

#define for_all_side_units(s, v)   for (v = (s)->unithead->next; v != (s)->unithead; v = v->next)
 Iterate over all units.

#define for_all_occupants(u1, v)   for (v = (u1)->occupant; v != NULL; v = v->nexthere)
 Iterate over direct components.

#define for_all_occs_with_occs(u, var)
 Iterate over ALL components.

#define is_unit(unit)   ((unit) != NULL && is_unit_type((unit)->type))
 Is valid Unit type?

#define alive(unit)   ((unit)->hp > 0)
 Is alive?

#define indep(unit)   ((unit)->side == indepside)
 Is independant?

#define completed(unit)   ((unit)->cp >= u_cp((unit)->type))
 Is complete?

#define unit_alt(unit)   (((unit)->z & 1) == 0 ? ((unit)->z >> 1) : 0)
 Unit altitude.

#define unit_conn(unit)   (((unit)->z & 1) == 1 ? ((unit)->z >> 1) : NONTTYPE)
 Unit connection.

#define in_play(unit)   (is_unit(unit) && alive(unit) && inside_area((unit)->x, (unit)->y))
#define is_active(unit)   (in_play(unit) && completed(unit))
 Is Unit Active?

#define is_located_at(unit, x, y)   (in_play(unit) && (unit)->x == wrapx(x) && (unit)->y == (y))
 Is unit located at (x,y)?

#define was_located_at(unit, x, y)   (is_unit(unit) && (unit)->prevx == wrapx(x) && (unit)->prevy == (y))
 Was unit located at (x,y)?

#define side_tracking_unit(side, unit)   (side_in_set((side), (unit)->tracking))
 Is unit being tracked?

#define unit_opinion(unit, side)   ((unit)->opinions != NULL ? x_opinion((unit)->opinions[side_number(side)]) : 0)
 Unit opinion.

#define unit_courage(unit, side)   ((unit)->opinions != NULL ? x_courage((unit)->opinions[side_number(side)]) : 0)
 Unit courage.

#define x_opinion(val)   (((val) & 0xff) - 128)
 Extract opinion.

#define x_courage(val)   (((val) >> 8) & 0xff)
 Extract courage.

#define s_opinion(val, val2)   (((val) & ~0xff) | (val2 + 128))
 Set opinion value.

#define s_courage(val, val2)   (((val) & ~0xff00) | (val2 << 8))
 Set courage value.

#define supply_inflow(unit)   ((unit)->s_flow / 163)
#define supply_connectedness(unit)   ((unit)->s_conn / 254)
#define DETONATE_FLAG_BIT   0
#define was_detonated(unit)   ((unit)->flags & (1 << DETONATE_FLAG_BIT))
#define set_was_detonated(unit, v)
#define unit_point_value(unit)   ((unit)->extras ? (unit)->extras->point_value : -1)
#define unit_appear_turn(unit)   ((unit)->extras ? (unit)->extras->appear : -1)
#define unit_appear_var_x(unit)   ((unit)->extras ? (unit)->extras->appear_var_x : -1)
#define unit_appear_var_y(unit)   ((unit)->extras ? (unit)->extras->appear_var_y : -1)
#define unit_disappear_turn(unit)   ((unit)->extras ? (unit)->extras->disappear : -1)
#define unit_extra_priority(unit)   ((unit)->extras ? (unit)->extras->priority : -1)
#define unit_symbol(unit)   ((unit)->extras ? (unit)->extras->sym : lispnil)
#define unit_sides(unit)   ((unit)->extras ? (unit)->extras->sides : lispnil)
#define unit_doctrine(unit)   ((unit)->side->udoctrine[(unit)->type])
#define construction_run_doctrine(unit, u2)   (unit_doctrine(unit)->construction_run[u2])
#define unit_side_treasury(unit)   ((unit)->side->treasury)
#define MAXSORTKEYS   5
#define unit_in_vector(uvec, ix)   ((uvec)->units[ix].unit)
 Unit in vector?

#define DEF_ACTION(name, CODE, args, prepfn, netprepfn, dofn, checkfn, argdecl, doc)   CODE,
#define MAXACTIONARGS   4
 Maximum number of arguments to action.

#define valid(x)   ((x) == A_ANY_OK)
#define has_pending_action(unit)   ((unit)->act && (unit)->act->nextaction.type != ACTION_NONE)
#define acp_indep(unit)   u_acp_independent((unit)->type)
#define has_acp_left(unit)   ((unit)->act && ((0 < (unit)->act->acp) || acp_indep(unit)))
 Does unit have ACP left?

#define type_acp_max(u)   ((u_acp_max(u) >= 0) ? u_acp_max(u) : u_acp(u))
#define DEF_GOAL(name, dname, GOALTYPE, args)   GOALTYPE,
#define MAXGOALARGS   5
 Maximum number of goal arguments.

#define DEF_TASK(name, dname, CODE, argtypes, dofn, createfn, setfn, netsetfn, pushfn, netpushfn, argdecl)   CODE,
#define MAXTASKARGS   6
 Maximum arguments for a task.

#define is_task_type(x)   (between(0, (x), NUMTASKTYPES - 1))
#define DEF_PLAN(name, CODE)   CODE,
#define for_all_tasks(plan, task)   for (task = (plan)->tasks; task != NULL; task = task->next)
#define ai_controlled(unit)   ((unit)->plan && (unit)->plan->aicontrol && side_has_ai(unit->side))
#define could_auto_upgrade_to(u, u2)   ((u2) == u_auto_upgrade_to(u))
#define DEF_ACTION(name, code, args, prepfn, netprepfn, dofn, CHECKFN, ARGDECL, doc)   extern int CHECKFN ARGDECL;
#define DEF_TASK(name, dname, code, argtypes, dofn, CREATEFN, setfn, netsetfn, pushfn, netpushfn, ARGDECL)   extern Task *CREATEFN ARGDECL;

Typedefs

typedef a_unit Unit
 Unit.

typedef a_unit_extras UnitExtras
 Unit exta options.

typedef a_unit_view UnitView
 Unit View.

typedef a_seer_node SeerNode
typedef a_unitvectorentry UnitVectorEntry
typedef a_unitvector UnitVector
typedef enum actiontype ActionType
 Action types.

typedef a_actiondefn ActionDefn
 Action definition.

typedef a_action Action
 Action.

typedef a_actorstate ActorState
typedef enum goaltype GoalType
typedef a_goaldefn GoalDefn
 Goal definition.

typedef a_goal Goal
 Goal.

typedef enum a_tasktype TaskType
 Task type.

typedef enum a_taskoutcome TaskOutcome
 Task outcome.

typedef a_task Task
 Task.

typedef a_taskdefn TaskDefn
 Task definition.

typedef enum plantype PlanType
 Plan type.

typedef a_plan Plan
 Plan.


Enumerations

enum  sortkeys {
  bynothing, bytype, byname, byactorder,
  bylocation, byside, numsortkeytypes
}
 Sort types. More...

enum  actiontype {
  none, ACTION_NONE, prep_none_action, net_prep_none_action,
  do_none_action, check_none_action, unit, unit2,
  used, move, ACTION_MOVE, xyz,
  prep_move_action, net_prep_move_action, do_move_action, check_move_action,
  unit, unit2, x, y,
  z, enter, ACTION_ENTER, U,
  prep_enter_action, net_prep_enter_action, do_enter_action, check_enter_action,
  unit, unit2, dest, attack,
  ACTION_ATTACK, Un, prep_attack_action, net_prep_attack_action,
  do_attack_action, check_attack_action, unit, unit2,
  defender, n, overrun, ACTION_OVERRUN,
  xyzn, prep_overrun_action, net_prep_overrun_action, do_overrun_action,
  check_overrun_action, unit, unit2, x,
  y, z, n, at,
  ACTION_FIRE_AT, Um, prep_fire_at_action, net_prep_fire_at_action,
  do_fire_at_action, check_fire_at_action, unit, unit2,
  defender, m, into, ACTION_FIRE_INTO,
  xyzm, prep_fire_into_action, net_prep_fire_into_action, do_fire_into_action,
  check_fire_into_action, unit, unit2, x,
  y, z, m, capture,
  ACTION_CAPTURE, U, prep_capture_action, net_prep_capture_action,
  do_capture_action, check_capture_action, unit, unit2,
  defender, detonate, ACTION_DETONATE, xyz,
  prep_detonate_action, net_prep_detonate_action, do_detonate_action, check_detonate_action,
  unit, unit2, x, y,
  z, produce, ACTION_PRODUCE, mn,
  prep_produce_action, net_prep_produce_action, do_produce_action, check_produce_action,
  unit, unit2, m, n,
  extract, ACTION_EXTRACT, xymn, prep_extract_action,
  net_prep_extract_action, do_extract_action, check_extract_action, unit,
  unit2, x, y, m,
  n, transfer, ACTION_TRANSFER, mnU,
  prep_transfer_action, net_prep_transfer_action, do_transfer_action, check_transfer_action,
  unit, unit2, m, n,
  unit3, develop, ACTION_DEVELOP, u,
  prep_develop_action, net_prep_develop_action, do_develop_action, check_develop_action,
  unit, unit2, u3, toolup,
  ACTION_TOOL_UP, u, prep_toolup_action, net_prep_toolup_action,
  do_toolup_action, check_toolup_action, unit, unit2,
  u3, in, ACTION_CREATE_IN, uU,
  prep_create_in_action, net_prep_create_in_action, do_create_in_action, check_create_in_action,
  actor, creator, u3, dest,
  at, ACTION_CREATE_AT, uxyz, prep_create_at_action,
  net_prep_create_at_action, do_create_at_action, check_create_at_action, actor,
  creator, u3, x, y,
  z, build, ACTION_BUILD, U,
  prep_build_action, net_prep_build_action, do_build_action, check_build_action,
  actor, builder, newunit, repair,
  ACTION_REPAIR, U, prep_repair_action, net_prep_repair_action,
  do_repair_action, check_repair_action, actor, repairer,
  repairee, disband, ACTION_DISBAND, prep_disband_action,
  net_prep_disband_action, do_disband_action, check_disband_action, unit,
  unit2, type, ACTION_CHANGE_TYPE, u,
  prep_change_type_action, net_prep_change_type_action, do_change_type_action, check_change_type_action,
  unit, unit2, u3, side,
  ACTION_CHANGE_SIDE, S, prep_change_side_action, net_prep_change_side_action,
  do_change_side_action, check_change_side_action, unit, unit2,
  side, terrain, ACTION_ALTER_TERRAIN, xyt,
  prep_alter_cell_action, net_prep_alter_cell_action, do_alter_cell_action, check_alter_cell_action,
  unit, unit2, x, y,
  t, terrain, ACTION_ADD_TERRAIN, xydt,
  prep_add_terrain_action, net_prep_add_terrain_action, do_add_terrain_action, check_add_terrain_action,
  unit, unit2, x, y,
  dir, t, terrain, ACTION_REMOVE_TERRAIN,
  xydt, prep_remove_terrain_action, net_prep_remove_terrain_action, do_remove_terrain_action,
  check_remove_terrain_action, unit, unit2, x,
  y, dir, t, NUMACTIONTYPES
}
 Action types. More...

enum  goaltype { g_t_dummy }
 Goal Type. More...

enum  a_tasktype {
  none, None, TASK_NONE, do_none_task,
  create_none_task, set_none_task, net_set_none_task, push_none_task,
  net_push_none_task, build, of, TASK_BUILD,
  Un, do_build_task, create_build_task, set_build_task,
  net_set_build_task, push_build_task, net_push_build_task, unit,
  id, capture, Capture, TASK_CAPTURE,
  Unn, do_capture_task, create_capture_task, set_capture_task,
  net_set_capture_task, push_capture_task, net_push_capture_task, unit,
  id, capmethod, collect, Collect,
  TASK_COLLECT, mxy, do_collect_task, create_collect_task,
  set_collect_task, net_set_collect_task, push_collect_task, net_push_collect_task,
  unit, m, x, construct,
  Construct, TASK_CONSTRUCT, unUxy, do_construct_task,
  create_construct_task, set_construct_task, net_set_construct_task, push_construct_task,
  net_push_construct_task, unit, u, run,
  transid, x, develop, Develop,
  TASK_DEVELOP, un, do_develop_task, create_develop_task,
  set_develop_task, net_set_develop_task, push_develop_task, net_push_develop_task,
  unit, u, disband, Disband,
  TASK_DISBAND, do_disband_task, create_disband_task, set_disband_task,
  net_set_disband_task, push_disband_task, net_push_disband_task, pos,
  position, TASK_HIT_POSITION, xyz, do_hit_position_task,
  create_hit_position_task, set_hit_position_task, net_set_hit_position_task, push_hit_position_task,
  net_push_hit_position_task, unit, x, y,
  unit, Hit, TASK_HIT_UNIT, Un,
  do_hit_unit_task, create_hit_unit_task, set_hit_unit_task, net_set_hit_unit_task,
  push_hit_unit_task, net_push_hit_unit_task, unit, id,
  hitmethod, dir, dir, TASK_MOVE_DIR,
  dn, do_move_dir_task, create_move_dir_task, set_move_dir_task,
  net_set_move_dir_task, push_move_dir_task, net_push_move_dir_task, unit,
  d, to, to, TASK_MOVE_TO,
  xyznc, do_move_to_task, create_move_to_task, set_move_to_task,
  net_set_move_to_task, push_move_to_task, net_push_move_to_task, unit,
  x, y, occupy, Occupy,
  TASK_OCCUPY, Uc, do_occupy_task, create_occupy_task,
  set_occupy_task, net_set_occupy_task, push_occupy_task, net_push_occupy_task,
  unit, pickup, Pickup, TASK_PICKUP,
  Uc, do_pickup_task, create_pickup_task, set_pickup_task,
  net_set_pickup_task, push_pickup_task, net_push_pickup_task, unit,
  produce, Produce, TASK_PRODUCE, mnn,
  do_produce_task, create_produce_task, set_produce_task, net_set_produce_task,
  push_produce_task, net_push_produce_task, unit, m,
  repair, Repair, TASK_REPAIR, Un,
  do_repair_task, create_repair_task, set_repair_task, net_set_repair_task,
  push_repair_task, net_push_repair_task, unit, id,
  resupply, Resupply, TASK_RESUPPLY, mU,
  do_resupply_task, create_resupply_task, set_resupply_task, net_set_resupply_task,
  push_resupply_task, net_push_resupply_task, unit, sentry,
  Sentry, TASK_SENTRY, n, do_sentry_task,
  create_sentry_task, set_sentry_task, net_set_sentry_task, push_sentry_task,
  net_push_sentry_task, unit, NUMTASKTYPES
}
 Task type. More...

enum  a_taskoutcome {
  TASK_UNKNOWN, TASK_FAILED, TASK_IS_INCOMPLETE, TASK_PREPPED_ACTION,
  TASK_IS_COMPLETE
}
 Task outcome. More...

enum  plantype { NUMPLANTYPES }
 Plan type. More...


Functions

int side_owns_occupant_of_unit (Side *side, Unit *unit)
int side_owns_viewer_in_unit (Side *side, Unit *unit)
int type_can_occupy_cell (int u, int x, int y)
int side_thinks_type_can_occupy_cell (Side *side, int u, int x, int y)
int type_can_occupy_empty_cell (int u, int x, int y)
int type_can_occupy_terrain (int u, int t)
int can_occupy_cell_without (Unit *unit, int x, int y, Unit *unit3)
int type_can_occupy_cell_without (int u, int x, int y, Unit *unit3)
int side_can_put_type_at (Side *side, int u, int x, int y)
int side_can_put_type_at_without (Side *side, int u, int x, int y, Unit *unit)
int side_thinks_it_can_put_type_at (Side *side, int u, int x, int y)
int side_thinks_it_can_put_type_at_without (Side *side, int u, int x, int y, Unit *unit)
int can_occupy (Unit *unit, Unit *transport)
int type_can_occupy (int u, Unit *transport)
int side_thinks_type_can_occupy (Side *side, int u, UnitView *transport)
int type_can_occupy_without (int u, Unit *transport, Unit *unit)
int side_thinks_type_can_occupy_without (int u, UnitView *transport, Unit *unit)
int type_can_occupy_empty_type (int u, int u2)
int type_can_have_occs (int u)
int new_unit_allowed_on_side (int u, Side *side)
int unit_allowed_on_side (Unit *unit, Side *side)
int num_sides_allowed (int u)
int type_allowed_on_side (int u, Side *side)
int type_ever_available (int u, Side *side)
int unit_trusts_unit (Unit *unit1, Unit *unit2)
int type_survives_in_cell (int u, int nx, int ny)
int type_survives_in_terrain (int u, int t)
int can_build (Unit *unit)
int type_can_build (int u, Side *side)
int can_move (Unit *unit)
int can_extract_at (Unit *unit, int x, int y, int *mp)
int can_load_at (Unit *unit, int x, int y, int *mp)
int can_develop (Unit *unit)
int type_can_develop (int u)
int can_change_type (Unit *unit)
int can_change_type_to (Unit *unit, int u2)
int could_change_type (int u)
int could_change_type_to (int u, int u2)
int can_disband (Unit *unit)
int type_can_disband (int u)
int side_can_disband (Side *side, Unit *unit)
int can_add_terrain (Unit *unit)
int type_can_add_terrain (int u)
int can_remove_terrain (Unit *unit)
int type_can_remove_terrain (int u)
int can_build_attackers (Side *side, int u)
int can_build_defenders (Side *side, int u)
int can_build_explorers (Side *side, int u)
int can_build_colonizers (Side *side, int u)
int can_build_facilities (Side *side, int u)
int can_build_or_help (Unit *unit)
int can_research (Unit *unit)
int can_produce (Unit *unit)
int total_production (Unit *unit, int m)
int base_production (Unit *unit, int m)
int total_consumption (Unit *unit, int m)
int base_consumption (Unit *unit, int m)
int survival_time (Unit *unit)
int will_not_move (Unit *unit)
int needs_material_to_move (Unit *unit, int m)
int needs_material_to_survive (Unit *unit, int m)
int operating_range_best (int u)
int operating_range_worst (int u)
int real_operating_range_best (Unit *unit)
int real_operating_range_worst (Unit *unit)
int can_build_type (Unit *unit, int u2)
int can_develop_or_build_type (Unit *unit, int u2)
int unit_can_build_type_at (Unit *unit, int u2, int x, int y)
int unit_can_build_type (Unit *unit, int u2)
int type_can_build_type (int u, Side *side, int u2)
Unitincomplete_build_target (Unit *unit)
int see_chance (int u, int u2, int dist)
int see_chance (Unit *seer, Unit *tosee)
char * unit_desig (Unit *unit)
char * unit_desig_no_loc (Unit *unit)
char * utype_name_n (int u, int n)
char * shortest_unique_name (int u)
char * shortest_generic_name (int u)
char * actorstate_desig (struct a_actorstate *as)
Unitfind_unit (int n)
Unitfind_unit_dead_or_alive (int n)
Unitfind_unit_by_name (char *nm)
Unitfind_unit_by_number (int nb)
Unitfind_unit_by_symbol (Obj *sym)
UnitVectormake_unit_vector (int initsize)
void clear_unit_vector (UnitVector *vec)
UnitVectoradd_unit_to_vector (UnitVector *vec, Unit *unit, int flag)
void remove_unit_from_vector (UnitVector *vec, Unit *unit, int pos)
void sort_unit_vector (UnitVector *vec)
void sort_units (int byidonly)
void check_all_units (void)

Variables

short default_size
 Advanced : default size.

short default_usedcells
 Advanced : default used cells.

short default_maxcells
 Advanced : default max cells.

long default_population
 Advanced : default population.

UnitViewviewlist
Unitunitlist
 Unit list.

Unittmpunit
 Unit temporary.

int numunits
 Number of Units.

int numliveunits
 Number of live Units.

enum sortkeys tmpsortkeys []
 Temporary sort keys.

ActionDefn actiondefns []
 Action function table.

GoalDefn goaldefns []
 Goal definition array.

TaskDefn taskdefns []
 Task definition array.

char * plantypenames []
 Plan type name array.


Detailed Description

Definitions relating to units in Xconq.

Prototypes, constants, and macros relating to units.


Define Documentation

#define acp_indep unit   )     u_acp_independent((unit)->type)
 

#define ai_controlled unit   )     ((unit)->plan && (unit)->plan->aicontrol && side_has_ai(unit->side))
 

#define alive unit   )     ((unit)->hp > 0)
 

Is alive?

Is this unit alive?

Parameters:
unit is a pointer to a .
Returns:
TRUE if the Unit has at least 1 HP.

#define completed unit   )     ((unit)->cp >= u_cp((unit)->type))
 

Is complete?

Has this been completed?

Parameters:
unit is a pointer to a .
Returns:
TRUE if the Unit has been completed.

#define construction_run_doctrine unit,
u2   )     (unit_doctrine(unit)->construction_run[u2])
 

#define could_auto_upgrade_to u,
u2   )     ((u2) == u_auto_upgrade_to(u))
 

#define DEF_ACTION name,
code,
args,
prepfn,
netprepfn,
dofn,
CHECKFN,
ARGDECL,
doc   )     extern int CHECKFN ARGDECL;
 

#define DEF_ACTION name,
CODE,
args,
prepfn,
netprepfn,
dofn,
checkfn,
argdecl,
doc   )     CODE,
 

#define DEF_GOAL name,
dname,
GOALTYPE,
args   )     GOALTYPE,
 

#define DEF_PLAN name,
CODE   )     CODE,
 

#define DEF_TASK name,
dname,
code,
argtypes,
dofn,
CREATEFN,
setfn,
netsetfn,
pushfn,
netpushfn,
ARGDECL   )     extern Task *CREATEFN ARGDECL;
 

#define DEF_TASK name,
dname,
CODE,
argtypes,
dofn,
createfn,
setfn,
netsetfn,
pushfn,
netpushfn,
argdecl   )     CODE,
 

#define DETONATE_FLAG_BIT   0
 

#define for_all_occs_with_occs u,
var   ) 
 

Value:

for ((var) = (u)->occupant; \
       (var) != NULL && (var) != (u)->nexthere; \
         (var) = ((var)->occupant != NULL ? \
                        (var)->occupant : \
                      ((var)->nexthere != NULL ? \
                        (var)->nexthere : \
                      ((var)->transport != NULL && \
                        (var)->transport->nexthere != NULL ? \
                        (var)->transport->nexthere : \
                      ((var)->transport != NULL && \
                        (var)->transport->transport != NULL && \
                        (var)->transport->transport->nexthere != NULL ? \
                        (var)->transport->transport->nexthere : NULL)))))
Iterate over ALL components.

Iterate through all occupants including occupents within occupents within occupents within . This nifty little macro will climb the occupant : nexthere tree and follow all branches three levels below (u) to find all the occs within occs within occs within (u). The test for (var) != (u)->nexthere is to stop the macro from climbing up above (u).

See also:
for_all_units
Parameters:
u is a pointer to the .
var is the iteration varable.

#define for_all_occupants u1,
 )     for (v = (u1)->occupant; v != NULL; v = v->nexthere)
 

Iterate over direct components.

Iteration over all occupants of a (but not sub-occupants).

See also:
for_all_units
Parameters:
u1 is pointer to unit list.
v is the iteration parameter.

#define for_all_side_units s,
 )     for (v = (s)->unithead->next; v != (s)->unithead; v = v->next)
 

Iterate over all units.

Iteration over all on a given side.

See also:
for_all_units
Parameters:
s is a pointer to a .
v is the view iteration parameter.

#define for_all_tasks plan,
task   )     for (task = (plan)->tasks; task != NULL; task = task->next)
 

#define for_all_units  )     for (v = unitlist; v != NULL; v = v->unext)
 

Iteration over all units.

For header to iterat through all .

Note:
Since it is possible for a unit to change sides and therefore prev/next pointers while iterating using the macros below, one must be very careful either that unit sides can't change during the loop, or else to maintain a temp var that can be used to repair the iteration. This also applies to units dying.
Parameters:
v is the Unit vector list iteration variable.

#define has_acp_left unit   )     ((unit)->act && ((0 < (unit)->act->acp) || acp_indep(unit)))
 

Does unit have ACP left?

This is true if the unit still has acp left to act with. This used to test acp > acp-min, but that allows units to move around with negative acp, and doesn't work as well in game designs. Now returns TRUE if an acp-independent unit that can build is either waiting for tasks or not yet done with construction for this turn.

Parameters:
unit is pointer to unit.

#define has_pending_action unit   )     ((unit)->act && (unit)->act->nextaction.type != ACTION_NONE)
 

#define in_play unit   )     (is_unit(unit) && alive(unit) && inside_area((unit)->x, (unit)->y))
 

Unit in play. This is true if the unit is on the board somewhere.

See also:
is_unit, alive, inside_area.
Parameters:
unit is the pointer to the .
Returns:
TRUE if it is a unit AND it's alive AND it's in a cell on the board.

#define indep unit   )     ((unit)->side == indepside)
 

Is independant?

Is this independant?

Parameters:
unit is a pointer to a .
Returns:
TRUE if the Unit belongs to an independant.

#define is_active unit   )     (in_play(unit) && completed(unit))
 

Is Unit Active?

Is the unit currently available?

See also:
in_play, completed.
Parameters:
unit is the pointer to the .
Returns:
TRUE if it is in play and completed.

#define is_located_at unit,
x,
 )     (in_play(unit) && (unit)->x == wrapx(x) && (unit)->y == (y))
 

Is unit located at (x,y)?

Is unit in play and located at (x,y)?

See also:
in_play, wrapx.
Parameters:
unit is the pointer to the .
x is a possibly unwrapped x co-ordinate.
y is a y co-ordinate.
Returns:
TRUE if unit is in play and located at (wrap(x), y).

#define is_task_type  )     (between(0, (x), NUMTASKTYPES - 1))
 

#define is_unit unit   )     ((unit) != NULL && is_unit_type((unit)->type))
 

Is valid Unit type?

Check to see if is a valid Unit type.

Parameters:
unit is a pointer to a .
Returns:
TRUE if the type of a is a valid type.

#define MAXACTIONARGS   4
 

Maximum number of arguments to action.

#define MAXGOALARGS   5
 

Maximum number of goal arguments.

#define MAXSORTKEYS   5
 

Can sort on as many as five keys.

#define MAXTASKARGS   6
 

Maximum arguments for a task.

#define s_courage val,
val2   )     (((val) & ~0xff00) | (val2 << 8))
 

Set courage value.

Set the courage value. Mask old value and 'or' in new value.

Parameters:
val is the opinion word.
val2 is the new courage part of the opinion word.
Returns:
new 'opinion' word.

#define s_opinion val,
val2   )     (((val) & ~0xff) | (val2 + 128))
 

Set opinion value.

Set the opinion value. Mask old value and 'or' in new value.

Parameters:
val is the opinion word.
val2 is the new opinion part of the opinion word.
Returns:
new 'opion' word.

#define set_was_detonated unit,
 ) 
 

Value:

((v) ? ((unit)->flags |= 1 << DETONATE_FLAG_BIT) \
   : ((unit)->flags &= ~(1 << DETONATE_FLAG_BIT)))

#define side_tracking_unit side,
unit   )     (side_in_set((side), (unit)->tracking))
 

Is unit being tracked?

Is a side watching a ?

See also:
side_in_set.
Parameters:
side is a pointer to a .
unit is the pointer to the .
Returns:
TRUE if the side bit for the side is set in the tracking mask.

#define supply_connectedness unit   )     ((unit)->s_conn / 254)
 

#define supply_inflow unit   )     ((unit)->s_flow / 163)
 

#define type_acp_max  )     ((u_acp_max(u) >= 0) ? u_acp_max(u) : u_acp(u))
 

#define unit_alt unit   )     (((unit)->z & 1) == 0 ? ((unit)->z >> 1) : 0)
 

Unit altitude.

Extractor for the actual altitude of an airborne unit.

Parameters:
unit is a pointer to a .
Returns:
altitude of unit or zero.

#define unit_appear_turn unit   )     ((unit)->extras ? (unit)->extras->appear : -1)
 

#define unit_appear_var_x unit   )     ((unit)->extras ? (unit)->extras->appear_var_x : -1)
 

#define unit_appear_var_y unit   )     ((unit)->extras ? (unit)->extras->appear_var_y : -1)
 

#define unit_conn unit   )     (((unit)->z & 1) == 1 ? ((unit)->z >> 1) : NONTTYPE)
 

Unit connection.

Extractor for the connection a unit is on.

#define unit_courage unit,
side   )     ((unit)->opinions != NULL ? x_courage((unit)->opinions[side_number(side)]) : 0)
 

Unit courage.

courage is the upper byte of the unit opinon array.

See also:
unit_opinion, x_courage, side_number.
Parameters:
unit is a pointer to the .
side is a pointer to the .
Returns:
  • < 0 if fearful,
  • = 0 if neutral or not defined, or
  • > 0 if couragous.

#define unit_disappear_turn unit   )     ((unit)->extras ? (unit)->extras->disappear : -1)
 

#define unit_doctrine unit   )     ((unit)->side->udoctrine[(unit)->type])
 

#define unit_extra_priority unit   )     ((unit)->extras ? (unit)->extras->priority : -1)
 

#define unit_in_vector uvec,
ix   )     ((uvec)->units[ix].unit)
 

Unit in vector?

Given an index into a unit vector, return the unit.

#define unit_opinion unit,
side   )     ((unit)->opinions != NULL ? x_opinion((unit)->opinions[side_number(side)]) : 0)
 

Unit opinion.

opinion, if defined, is an array of 2-byte values, one per side, indexed by side number. Each value consists of a low byte, which is the for/against strength (positive is "for", negative is "against", neutral is 0), and a high byte, which is the level of courage/fear (positive is courage, negative is fear).

See also:
unit_courage, x_opinion, side_number.
Parameters:
unit is a pointer to the .
side is a pointer to the .
Returns:
  • < 0 if against,
  • = 0 if neutral or not defined, or
  • > 0 if for.

#define unit_point_value unit   )     ((unit)->extras ? (unit)->extras->point_value : -1)
 

#define unit_side_treasury unit   )     ((unit)->side->treasury)
 

#define unit_sides unit   )     ((unit)->extras ? (unit)->extras->sides : lispnil)
 

#define unit_symbol unit   )     ((unit)->extras ? (unit)->extras->sym : lispnil)
 

#define valid  )     ((x) == A_ANY_OK)
 

#define was_detonated unit   )     ((unit)->flags & (1 << DETONATE_FLAG_BIT))
 

#define was_located_at unit,
x,
 )     (is_unit(unit) && (unit)->prevx == wrapx(x) && (unit)->prevy == (y))
 

Was unit located at (x,y)?

Was unit (maybe now dead) located at (x,y)?

See also:
is_unit, wrapx.
Parameters:
unit is the pointer to the .
x is a possibly unwrapped x co-ordinate.
y is a y co-ordinate.
Returns:
TRUE if unit previously was located at (wrap(x), y).
Since:
unit may be dead now, we just test for is_unit instead of in_play.

#define x_courage val   )     (((val) >> 8) & 0xff)
 

Extract courage.

Extract the high order byte, and convert to +- range.

Parameters:
val is the value to extract
Returns:
high byte value in range -128/127.

#define x_opinion val   )     (((val) & 0xff) - 128)
 

Extract opinion.

Extract the low order byte, and convert to +- range.

Parameters:
val is the value to extract
Returns:
low byte value in range -128/127.


Typedef Documentation

typedef struct a_action Action
 

Action.

typedef struct a_actiondefn ActionDefn
 

Action definition.

typedef enum actiontype ActionType
 

Action types.

Types of primitive unit actions.

typedef struct a_actorstate ActorState
 

Actor state.

typedef struct a_goal Goal
 

Goal.

typedef struct a_goaldefn GoalDefn
 

Goal definition.

typedef enum goaltype GoalType
 

typedef struct a_plan Plan
 

Plan.

typedef enum plantype PlanType
 

Plan type.

A plan is what a single unit uses to make decisions, both for itself and for any other units it commands. Any unit that can act at all has a plan object. A plan collects lots of unit behavior, but its most important structure is the task queue, which contains a list of what to do next, in order. Plan types distinguish several kinds of usages.

typedef struct a_seer_node SeerNode
 

typedef struct a_task Task
 

Task.

typedef struct a_taskdefn TaskDefn
 

Task definition.

typedef enum a_taskoutcome TaskOutcome
 

Task outcome.

typedef enum a_tasktype TaskType
 

Task type.

A task is a single executable element of a unit's plan. Each task type is something that has been found useful or convenient to encapsulate as a step in a plan. Tasks are also useful for human interfaces to use instead of actions, since they have retry capabilities that are not part of action execution. Note that a task's arguments are not the same as the arguments passed to the functions that create and push tasks. For instance, the 'c' task argument is actually a state variable recording a direction choice; this is important for coherent routefinding, but is not needed in order to create a movement task.

typedef struct a_unit Unit
 

Unit.

The Unit structure should be small, because there may be many of them. Unit semantics go in this structure, while unit brains go into the act/plan. Test: a unit that is like a rock and can't do anything at all just needs basic slots, plan needn't be allocated. Another test: unit should still function correctly after its current plan has been destroyed and replae`d with another.

Note:
unit->side and unit->origside must always point to valid side objects; dereferences are not checked!

typedef struct a_unit_extras UnitExtras
 

Unit exta options.

The unit extras structure stores properties that are (usually) uncommon or special-purpose. It is allocated as needed, access is through macros, and this does not appear as a separate structure when saving/restoring. If a value is likely to be filled in for most or all units in several different game designs, then it should be in the main structure (even at the cost of extra space), rather than here.

typedef struct a_unitvector UnitVector
 

Sortable unit vector

typedef struct a_unitvectorentry UnitVectorEntry
 

Unit vector entry.

typedef struct a_unit_view UnitView
 

Unit View.

The is a partial mirror of an actual , including only the data that might be known to another side seeing the from a distance.


Enumeration Type Documentation

enum a_taskoutcome
 

Task outcome.

Enumeration values:
TASK_UNKNOWN  Unknown task.
TASK_FAILED  Task failed.
TASK_IS_INCOMPLETE  Task incomplete.
TASK_PREPPED_ACTION  Task prepped action.
TASK_IS_COMPLETE  Task complete.

enum a_tasktype
 

Task type.

A task is a single executable element of a unit's plan. Each task type is something that has been found useful or convenient to encapsulate as a step in a plan. Tasks are also useful for human interfaces to use instead of actions, since they have retry capabilities that are not part of action execution. Note that a task's arguments are not the same as the arguments passed to the functions that create and push tasks. For instance, the 'c' task argument is actually a state variable recording a direction choice; this is important for coherent routefinding, but is not needed in order to create a movement task.

Enumeration values:
none 
None 
TASK_NONE 
do_none_task 
create_none_task 
set_none_task 
net_set_none_task 
push_none_task 
net_push_none_task 
build 
of 
TASK_BUILD 
Un 
do_build_task 
create_build_task 
set_build_task 
net_set_build_task 
push_build_task 
net_push_build_task 
unit 
id 
capture 
Capture 
TASK_CAPTURE 
Unn 
do_capture_task 
create_capture_task 
set_capture_task 
net_set_capture_task 
push_capture_task 
net_push_capture_task 
unit 
id 
capmethod 
collect 
Collect 
TASK_COLLECT 
mxy 
do_collect_task 
create_collect_task 
set_collect_task 
net_set_collect_task 
push_collect_task 
net_push_collect_task 
unit 
m 
x 
construct 
Construct 
TASK_CONSTRUCT 
unUxy 
do_construct_task 
create_construct_task 
set_construct_task 
net_set_construct_task 
push_construct_task 
net_push_construct_task 
unit 
u 
run 
transid 
x 
develop 
Develop 
TASK_DEVELOP 
un 
do_develop_task 
create_develop_task 
set_develop_task 
net_set_develop_task 
push_develop_task 
net_push_develop_task 
unit 
u 
disband 
Disband 
TASK_DISBAND 
do_disband_task 
create_disband_task 
set_disband_task 
net_set_disband_task 
push_disband_task 
net_push_disband_task 
pos 
position 
TASK_HIT_POSITION 
xyz 
do_hit_position_task 
create_hit_position_task 
set_hit_position_task 
net_set_hit_position_task 
push_hit_position_task 
net_push_hit_position_task 
unit 
x 
y 
unit 
Hit 
TASK_HIT_UNIT 
Un 
do_hit_unit_task 
create_hit_unit_task 
set_hit_unit_task 
net_set_hit_unit_task 
push_hit_unit_task 
net_push_hit_unit_task 
unit 
id 
hitmethod 
dir 
dir 
TASK_MOVE_DIR 
dn 
do_move_dir_task 
create_move_dir_task 
set_move_dir_task 
net_set_move_dir_task 
push_move_dir_task 
net_push_move_dir_task 
unit 
d 
to 
to 
TASK_MOVE_TO 
xyznc 
do_move_to_task 
create_move_to_task 
set_move_to_task 
net_set_move_to_task 
push_move_to_task 
net_push_move_to_task 
unit 
x 
y 
occupy 
Occupy 
TASK_OCCUPY 
Uc 
do_occupy_task 
create_occupy_task 
set_occupy_task 
net_set_occupy_task 
push_occupy_task 
net_push_occupy_task 
unit 
pickup 
Pickup 
TASK_PICKUP 
Uc 
do_pickup_task 
create_pickup_task 
set_pickup_task 
net_set_pickup_task 
push_pickup_task 
net_push_pickup_task 
unit 
produce 
Produce 
TASK_PRODUCE 
mnn 
do_produce_task 
create_produce_task 
set_produce_task 
net_set_produce_task 
push_produce_task 
net_push_produce_task 
unit 
m 
repair 
Repair 
TASK_REPAIR 
Un 
do_repair_task 
create_repair_task 
set_repair_task 
net_set_repair_task 
push_repair_task 
net_push_repair_task 
unit 
id 
resupply 
Resupply 
TASK_RESUPPLY 
mU 
do_resupply_task 
create_resupply_task 
set_resupply_task 
net_set_resupply_task 
push_resupply_task 
net_push_resupply_task 
unit 
sentry 
Sentry 
TASK_SENTRY 
n 
do_sentry_task 
create_sentry_task 
set_sentry_task 
net_set_sentry_task 
push_sentry_task 
net_push_sentry_task 
unit 
NUMTASKTYPES 

enum actiontype
 

Action types.

Types of primitive unit actions.

Enumeration values:
none 
ACTION_NONE 
prep_none_action 
net_prep_none_action 
do_none_action 
check_none_action 
unit 
unit2 
used 
move 
ACTION_MOVE 
xyz 
prep_move_action 
net_prep_move_action 
do_move_action 
check_move_action 
unit 
unit2 
x 
y 
z 
enter 
ACTION_ENTER 
U 
prep_enter_action 
net_prep_enter_action 
do_enter_action 
check_enter_action 
unit 
unit2 
dest 
attack 
ACTION_ATTACK 
Un 
prep_attack_action 
net_prep_attack_action 
do_attack_action 
check_attack_action 
unit 
unit2 
defender 
n 
overrun 
ACTION_OVERRUN 
xyzn 
prep_overrun_action 
net_prep_overrun_action 
do_overrun_action 
check_overrun_action 
unit 
unit2 
x 
y 
z 
n 
at 
ACTION_FIRE_AT 
Um 
prep_fire_at_action 
net_prep_fire_at_action 
do_fire_at_action 
check_fire_at_action 
unit 
unit2 
defender 
m 
into 
ACTION_FIRE_INTO 
xyzm 
prep_fire_into_action 
net_prep_fire_into_action 
do_fire_into_action 
check_fire_into_action 
unit 
unit2 
x 
y 
z 
m 
capture 
ACTION_CAPTURE 
U 
prep_capture_action 
net_prep_capture_action 
do_capture_action 
check_capture_action 
unit 
unit2 
defender 
detonate 
ACTION_DETONATE 
xyz 
prep_detonate_action 
net_prep_detonate_action 
do_detonate_action 
check_detonate_action 
unit 
unit2 
x 
y 
z 
produce 
ACTION_PRODUCE 
mn 
prep_produce_action 
net_prep_produce_action 
do_produce_action 
check_produce_action 
unit 
unit2 
m 
n 
extract 
ACTION_EXTRACT 
xymn 
prep_extract_action 
net_prep_extract_action 
do_extract_action 
check_extract_action 
unit 
unit2 
x 
y 
m 
n 
transfer 
ACTION_TRANSFER 
mnU 
prep_transfer_action 
net_prep_transfer_action 
do_transfer_action 
check_transfer_action 
unit 
unit2 
m 
n 
unit3 
develop 
ACTION_DEVELOP 
u 
prep_develop_action 
net_prep_develop_action 
do_develop_action 
check_develop_action 
unit 
unit2 
u3 
toolup 
ACTION_TOOL_UP 
u 
prep_toolup_action 
net_prep_toolup_action 
do_toolup_action 
check_toolup_action 
unit 
unit2 
u3 
in 
ACTION_CREATE_IN 
uU 
prep_create_in_action 
net_prep_create_in_action 
do_create_in_action 
check_create_in_action 
actor 
creator 
u3 
dest 
at 
ACTION_CREATE_AT 
uxyz 
prep_create_at_action 
net_prep_create_at_action 
do_create_at_action 
check_create_at_action 
actor 
creator 
u3 
x 
y 
z 
build 
ACTION_BUILD 
U 
prep_build_action 
net_prep_build_action 
do_build_action 
check_build_action 
actor 
builder 
newunit 
repair 
ACTION_REPAIR 
U 
prep_repair_action 
net_prep_repair_action 
do_repair_action 
check_repair_action 
actor 
repairer 
repairee 
disband 
ACTION_DISBAND 
prep_disband_action 
net_prep_disband_action 
do_disband_action 
check_disband_action 
unit 
unit2 
type 
ACTION_CHANGE_TYPE 
u 
prep_change_type_action 
net_prep_change_type_action 
do_change_type_action 
check_change_type_action 
unit 
unit2 
u3 
side 
ACTION_CHANGE_SIDE 
S 
prep_change_side_action 
net_prep_change_side_action 
do_change_side_action 
check_change_side_action 
unit 
unit2 
side 
terrain 
ACTION_ALTER_TERRAIN 
xyt 
prep_alter_cell_action 
net_prep_alter_cell_action 
do_alter_cell_action 
check_alter_cell_action 
unit 
unit2 
x 
y 
t 
terrain 
ACTION_ADD_TERRAIN 
xydt 
prep_add_terrain_action 
net_prep_add_terrain_action 
do_add_terrain_action 
check_add_terrain_action 
unit 
unit2 
x 
y 
dir 
t 
terrain 
ACTION_REMOVE_TERRAIN 
xydt 
prep_remove_terrain_action 
net_prep_remove_terrain_action 
do_remove_terrain_action 
check_remove_terrain_action 
unit 
unit2 
x 
y 
dir 
t 
NUMACTIONTYPES 

enum goaltype
 

Goal Type.

The different types of goals. A goal is a predicate object that can be tested to see whether it has been achieved. As such, it is a relatively static object and may be shared.

Enumeration values:
g_t_dummy 

enum plantype
 

Plan type.

A plan is what a single unit uses to make decisions, both for itself and for any other units it commands. Any unit that can act at all has a plan object. A plan collects lots of unit behavior, but its most important structure is the task queue, which contains a list of what to do next, in order. Plan types distinguish several kinds of usages.

Enumeration values:
NUMPLANTYPES 

enum sortkeys
 

Sort types.

The kinds of sort keys available for list windows.

Enumeration values:
bynothing  No sort.
bytype  Sort by type.
byname  Sort by name.
byactorder  Sort by actions.
bylocation  Sort by location.
byside  Sord by side.
numsortkeytypes  Number sort key types.


Function Documentation

char* actorstate_desig struct a_actorstate as  ) 
 

UnitVector* add_unit_to_vector UnitVector vec,
Unit unit,
int  flag
 

int base_consumption Unit unit,
int  m
 

int base_production Unit unit,
int  m
 

int can_add_terrain Unit unit  ) 
 

int can_build Unit unit  ) 
 

int can_build_attackers Side side,
int  u
 

int can_build_colonizers Side side,
int  u
 

int can_build_defenders Side side,
int  u
 

int can_build_explorers Side side,
int  u
 

int can_build_facilities Side side,
int  u
 

int can_build_or_help Unit unit  ) 
 

int can_build_type Unit unit,
int  u2
 

int can_change_type Unit unit  ) 
 

Todo:
Move to 'aiunit.cc' where it probably belongs.

Fix prototype for separate actor/agent.

int can_change_type_to Unit unit,
int  u2
 

int can_develop Unit unit  ) 
 

int can_develop_or_build_type Unit unit,
int  u2
 

int can_disband Unit unit  ) 
 

int can_extract_at Unit unit,
int  x,
int  y,
int *  mp
 

int can_load_at Unit unit,
int  x,
int  y,
int *  mp
 

int can_move Unit unit  ) 
 

int can_occupy Unit unit,
Unit transport
 

int can_occupy_cell_without Unit unit,
int  x,
int  y,
Unit unit3
 

int can_produce Unit unit  ) 
 

int can_remove_terrain Unit unit  ) 
 

int can_research Unit unit  ) 
 

void check_all_units void   ) 
 

void clear_unit_vector UnitVector vec  ) 
 

int could_change_type int  u  ) 
 

int could_change_type_to int  u,
int  u2
 

Unit* find_unit int  n  ) 
 

Unit* find_unit_by_name char *  nm  ) 
 

Unit* find_unit_by_number int  nb  ) 
 

Unit* find_unit_by_symbol Obj sym  ) 
 

Unit* find_unit_dead_or_alive int  n  ) 
 

Unit* incomplete_build_target Unit unit  ) 
 

UnitVector* make_unit_vector int  initsize  ) 
 

int needs_material_to_move Unit unit,
int  m
 

int needs_material_to_survive Unit unit,
int  m
 

int new_unit_allowed_on_side int  u,
Side side
 

int num_sides_allowed int  u  ) 
 

int operating_range_best int  u  ) 
 

int operating_range_worst int  u  ) 
 

int real_operating_range_best Unit unit  ) 
 

int real_operating_range_worst Unit unit  ) 
 

void remove_unit_from_vector UnitVector vec,
Unit unit,
int  pos
 

int see_chance Unit seer,
Unit tosee
 

int see_chance int  u,
int  u2,
int  dist
 

char* shortest_generic_name int  u  ) 
 

char* shortest_unique_name int  u  ) 
 

int side_can_disband Side side,
Unit unit
 

int side_can_put_type_at Side side,
int  u,
int  x,
int  y
 

int side_can_put_type_at_without Side side,
int  u,
int  x,
int  y,
Unit unit
 

int side_owns_occupant_of_unit Side side,
Unit unit
 

int side_owns_viewer_in_unit Side side,
Unit unit
 

int side_thinks_it_can_put_type_at Side side,
int  u,
int  x,
int  y
 

int side_thinks_it_can_put_type_at_without Side side,
int  u,
int  x,
int  y,
Unit unit
 

int side_thinks_type_can_occupy Side side,
int  u,
UnitView transport
 

int side_thinks_type_can_occupy_cell Side side,
int  u,
int  x,
int  y
 

int side_thinks_type_can_occupy_without int  u,
UnitView transport,
Unit unit
 

void sort_unit_vector UnitVector vec  ) 
 

void sort_units int  byidonly  ) 
 

int survival_time Unit unit  ) 
 

int total_consumption Unit unit,
int  m
 

int total_production Unit unit,
int  m
 

int type_allowed_on_side int  u,
Side side
 

int type_can_add_terrain int  u  ) 
 

int type_can_build int  u,
Side side
 

int type_can_build_type int  u,
Side side,
int  u2
 

int type_can_develop int  u  ) 
 

int type_can_disband int  u  ) 
 

int type_can_have_occs int  u  ) 
 

int type_can_occupy int  u,
Unit transport
 

int type_can_occupy_cell int  u,
int  x,
int  y
 

int type_can_occupy_cell_without int  u,
int  x,
int  y,
Unit unit3
 

int type_can_occupy_empty_cell int  u,
int  x,
int  y
 

int type_can_occupy_empty_type int  u,
int  u2
 

int type_can_occupy_terrain int  u,
int  t
 

int type_can_occupy_without int  u,
Unit transport,
Unit unit
 

int type_can_remove_terrain int  u  ) 
 

int type_ever_available int  u,
Side side
 

int type_survives_in_cell int  u,
int  nx,
int  ny
 

int type_survives_in_terrain int  u,
int  t
 

int unit_allowed_on_side Unit unit,
Side side
 

int unit_can_build_type Unit unit,
int  u2
 

int unit_can_build_type_at Unit unit,
int  u2,
int  x,
int  y
 

char* unit_desig Unit unit  ) 
 

char* unit_desig_no_loc Unit unit  ) 
 

int unit_trusts_unit Unit unit1,
Unit unit2
 

char* utype_name_n int  u,
int  n
 

int will_not_move Unit unit  ) 
 


Variable Documentation

ActionDefn actiondefns[]
 

Action function table.

The table of all the action functions declared above. It uses CODE_DEF_ACTION and action.def above to generate an "extern int" declaration for every action (prep, do, and * check). Below it generates a table with 3 entries for each function, a code number (CODe), the name of the function (NAME), and the extended declaration list for the function (ARGS).

short default_maxcells
 

Advanced : default max cells.

long default_population
 

Advanced : default population.

short default_size
 

Advanced : default size.

short default_usedcells
 

Advanced : default used cells.

GoalDefn goaldefns[]
 

Goal definition array.

int numliveunits
 

Number of live Units.

int numunits
 

Number of Units.

char* plantypenames[]
 

Plan type name array.

TaskDefn taskdefns[]
 

Task definition array.

enum sortkeys tmpsortkeys[]
 

Temporary sort keys.

Unit* tmpunit
 

Unit temporary.

Unit* unitlist
 

Unit list.

UnitView* viewlist
 


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