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

game.h File Reference

Interface between game parameters and the rest of Xconq. More...

#include "lisp.h"
#include "utype.def"
#include "mtype.def"
#include "ttype.def"
#include "atype.def"
#include "gvar.def"
#include "table.def"

Include dependency graph for game.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  propertydefn
 Property definition. More...

struct  tabledefn
 Table definition. More...

struct  vardefn
 Global Variables definition. More...

struct  utype
 Unit Type Property Value. More...

struct  mtype
 Material type properties. More...

struct  ttype
 Terrain type properties. More...

struct  atype
 Advance type properties. More...

struct  a_globals
 Global data structure. More...


Defines

#define NONUTYPE   (-1)
 Non unit.

#define NONMTYPE   (-1)
 Non Material.

#define NONTTYPE   (-1)
 Non terrain.

#define BACKTTYPE   (-2)
 Bogus window background terrain.

#define NONATYPE   (-1)
 non advance.

#define DONE   (-2)
 Advance complete.

#define NOADVANCE   (-3)
 No advance.

#define PROPLO   -32768
 Low property value limit.

#define PROPHI   32767
 High property value limit.

#define TABLO   -32768
 Low value in table.

#define TABHI   32767
 High value in table.

#define TABINT   0
 Integer table.

#define TABDICE1   1
 Type 1 dice table.

#define TABDICE2   2
 Type 2 dice table.

#define VARLO   -2000000000
 Low value for globals.

#define VARHI   2000000000
 High value for globals.

#define DEF_UPROP_I(name, fname, doc, SLOT, lo, dflt, hi)   short SLOT; /*!< doc */
#define DEF_UPROP_S(name, fname, doc, SLOT, dflt)   char *SLOT; /*!< doc */
#define DEF_UPROP_L(name, fname, doc, SLOT)   Obj *SLOT; /*!< doc */
#define DEF_MPROP_I(name, fname, doc, SLOT, lo, dflt, hi)   short SLOT;
#define DEF_MPROP_S(name, fname, doc, SLOT, dflt)   char *SLOT;
#define DEF_MPROP_L(name, fname, doc, SLOT)   Obj *SLOT;
#define DEF_TPROP_I(name, fname, doc, SLOT, lo, dflt, hi)   short SLOT;
#define DEF_TPROP_S(name, fname, doc, SLOT, dflt)   char *SLOT;
#define DEF_TPROP_L(name, fname, doc, SLOT)   Obj *SLOT;
#define DEF_APROP_I(name, fname, doc, SLOT, lo, dflt, hi)   short SLOT;
#define DEF_APROP_S(name, fname, doc, SLOT, dflt)   char *SLOT;
#define DEF_APROP_L(name, fname, doc, SLOT)   Obj *SLOT;
#define DEF_VAR_I(name, fname, setfname, doc, VAR, lo, dflt, hi)   int VAR;
#define DEF_VAR_S(name, fname, setfname, doc, VAR, dflt)   char *VAR;
#define DEF_VAR_L(name, fname, setfname, doc, VAR, dflt)   Obj *VAR;
#define DEF_UPROP_I(name, FNAME, doc, slot, lo, dflt, hi)   int FNAME(int u);
#define DEF_UPROP_S(name, FNAME, doc, slot, dflt)   char *FNAME(int u);
#define DEF_UPROP_L(name, FNAME, doc, slot)   Obj *FNAME(int u);
#define DEF_MPROP_I(name, FNAME, doc, slot, lo, dflt, hi)   int FNAME(int m);
#define DEF_MPROP_S(name, FNAME, doc, slot, dflt)   char *FNAME(int m);
#define DEF_MPROP_L(name, FNAME, doc, slot)   Obj *FNAME(int m);
#define DEF_TPROP_I(name, FNAME, doc, slot, lo, dflt, hi)   int FNAME(int t);
#define DEF_TPROP_S(name, FNAME, doc, slot, dflt)   char *FNAME(int t);
#define DEF_TPROP_L(name, FNAME, doc, slot)   Obj *FNAME(int t);
#define DEF_APROP_I(name, FNAME, doc, slot, lo, dflt, hi)   int FNAME(int a);
#define DEF_APROP_S(name, FNAME, doc, slot, dflt)   char *FNAME(int a);
#define DEF_APROP_L(name, FNAME, doc, slot)   Obj *FNAME(int a);
#define DEF_VAR_I(str, FNAME, SETFNAME, doc, var, lo, dflt, hi)   int FNAME(void);
#define DEF_VAR_S(str, FNAME, SETFNAME, doc, var, dflt)   char *FNAME(void);
#define DEF_VAR_L(str, FNAME, SETFNAME, doc, var, dflt)   Obj *FNAME(void);
#define DEF_VAR_I(str, FNAME, SETFNAME, doc, var, lo, dflt, hi)   void SETFNAME(int val);
#define DEF_VAR_S(str, FNAME, SETFNAME, doc, var, dflt)   void SETFNAME(char *val);
#define DEF_VAR_L(str, FNAME, SETFNAME, doc, var, dflt)   void SETFNAME(Obj *val);
#define DEF_UU_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   int FNAME(int u1, int u2);
#define DEF_UM_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   int FNAME(int u, int m);
#define DEF_UT_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   int FNAME(int u, int t);
#define DEF_TM_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   int FNAME(int t, int m);
#define DEF_TT_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   int FNAME(int t1, int t2);
#define DEF_MM_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   int FNAME(int m1, int m2);
#define DEF_UA_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   int FNAME(int u, int a);
#define DEF_AM_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   int FNAME(int a, int m);
#define DEF_AA_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   int FNAME(int a1, int a2);
#define DEF_UU_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   extern short *TABLE, CNST;
#define DEF_UM_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   extern short *TABLE, CNST;
#define DEF_UT_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   extern short *TABLE, CNST;
#define DEF_TM_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   extern short *TABLE, CNST;
#define DEF_TT_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   extern short *TABLE, CNST;
#define DEF_MM_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   extern short *TABLE, CNST;
#define DEF_UA_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   extern short *TABLE, CNST;
#define DEF_AM_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   extern short *TABLE, CNST;
#define DEF_AA_TABLE(name, FNAME, doc, TABLE, CNST, lo, dflt, hi, valtype)   extern short *TABLE, CNST;
#define for_all_unit_types(v)   for (v = 0; v < numutypes; ++v)
 Iterate all Unit types.

#define for_all_material_types(v)   for (v = 0; v < nummtypes; ++v)
 Iterate all Material types.

#define for_all_terrain_types(v)   for (v = 0; v < numttypes; ++v)
 Iterate through all Terrain types.

#define for_all_advance_types(v)   for (v = 0; v < numatypes; ++v)
 Iterate through all Advance types.

#define for_all_aux_terrain_types(t)   for ((t) = first_auxt_type; (t) >= 0; (t) = next_auxt_type[(t)])
 Iterate through aux terrain types.

#define for_all_border_types(t)   for ((t) = first_bord_type; (t) >= 0; (t) = next_bord_type[(t)])
 Iterate through borders.

#define for_all_connection_types(t)   for ((t) = first_conn_type; (t) >= 0; (t) = next_conn_type[(t)])
 Iterate through connections.

#define checku(x)   if ((x) < 0 || (x) >= numutypes) utype_error(x);
 Check Unit type range.

#define checkm(x)   if ((x) < 0 || (x) >= nummtypes) mtype_error(x);
 Check Material type range.

#define checkt(x)   if ((x) < 0 || (x) >= numttypes) ttype_error(x);
 Check Terrain type range.

#define checka(x)   if ((x) < 0 || (x) >= numatypes) atype_error(x);
 Check Advance type range.

#define actor(u)   (u_acp(u) > 0)
 Is actor?

#define mobile(u)   (u_speed(u) > 0)
 Is mobile?

#define u_mobile(u)   (0 < mp_per_turn_max(u))
 Is utype mobile?

#define u_hp(u)   (u_hp_max(u))
 Unit hit points.

#define could_live_on(u, t)   (could_be_on(u, t) && !ut_vanishes_on(u, t) && !ut_wrecks_on(u, t))
 Can Unit survive on Terrain?

#define could_carry(u1, u2)   (uu_capacity_x(u1, u2) > 0 || uu_size(u2, u1) <= u_capacity(u1))
 Unit could carry Unit?

#define could_develop(u1, u2)   (uu_acp_to_develop(u1, u2) > 0)
 Unit could develop Unit?

#define impassable(u, x, y)   (!could_be_on((u)->type, terrain_at((x), (y))))
 Impassable?

#define isbase(u)   (u_is_base((u)->type))
 Is the Unit a base?

#define base_builder(u)   (u_is_base_builder((u)->type))
 Is the Unit a base builder?

#define istransport(u)   (u_is_transport((u)->type))
 Is the Unit a transport?

#define t_is_cell(t)   (t_subtype(t) == cellsubtype)
 Is the Terrain a cell?

#define t_is_border(t)   (t_subtype(t) == bordersubtype)
 Is the Terrain a border?

#define t_is_connection(t)   (t_subtype(t) == connectionsubtype)
 Is the Terrain a connection?

#define t_is_coating(t)   (t_subtype(t) == coatingsubtype)
 Is the Terrain a coating?

#define is_unit_type(u)   ((u) >= 0 && (u) < numutypes)
 Is the Unit type valid?

#define is_material_type(m)   ((m) >= 0 && (m) < nummtypes)
 Is the Material type valid?

#define is_terrain_type(t)   ((t) >= 0 && (t) < numttypes)
 Is the Terrain type valid?

#define is_advance_type(a)   ((a) >= 0 && (a) < numatypes)
 Is the Advance type valid?


Typedefs

typedef propertydefn PropertyDefn
 Property definition.

typedef tabledefn TableDefn
 Table definition.

typedef vardefn VarDefn
 Global Variables definition.

typedef utype Utype
 Unit Type Property Value.

typedef mtype Mtype
 Material type properties.

typedef ttype Ttype
 Terrain type properties.

typedef atype Atype
 Advance type properties.

typedef a_globals Globals
 Global data structure.


Enumerations

enum  Typetype { UTYP = 0, MTYP = 1, TTYP = 2, ATYP = 3 }
 Type of types. More...

enum  terrain_subtype { cellsubtype = 0, bordersubtype = 1, connectionsubtype = 2, coatingsubtype = 3 }
 Terrain subtypes. More...


Functions

int could_be_on (int u, int t)
 Could u be on t?

void utype_error (int u)
void mtype_error (int m)
void ttype_error (int t)
void atype_error (int s)
void init_types (void)
void init_globals (void)
int create_unit_type (void)
int create_material_type (void)
int create_terrain_type (void)
int create_advance_type (void)
void default_unit_type (int x)
void default_material_type (int x)
void default_terrain_type (int x)
void default_advance_type (int x)
void allocate_table (int tbl, int reset)
int numtypes_from_index_type (int x)
char * index_type_name (int x)
void disallow_more_unit_types (void)
void disallow_more_terrain_types (void)
void disallow_more_material_types (void)
void disallow_more_advance_types (void)
void count_terrain_subtypes (void)
int table_default (int(*getter)(int, int))
 Default value for table.

short uprop_i_default (int(*intgetter)(int))
 Default value for integer uprop.

char * uprop_s_default (char *(*strgetter)(int))
 Default value for string uprop.

Objuprop_l_default (Obj *(*objgetter)(int))
 Default value for Lisp uprop.

short tprop_i_default (int(*intgetter)(int))
 Default value for integer tprop.

char * tprop_s_default (char *(*strgetter)(int))
 Default value for string tprop.

Objtprop_l_default (Obj *(*objgetter)(int))
 Default value for Lisp tprop.

short mprop_i_default (int(*intgetter)(int))
 Default value for integer mprop.

char * mprop_s_default (char *(*strgetter)(int))
 Default value for string mprop.

Objmprop_l_default (Obj *(*objgetter)(int))
 Default value for Lisp mprop.

short aprop_i_default (int(*intgetter)(int))
 Default value for integer aprop.

char * aprop_s_default (char *(*strgetter)(int))
 Default value for string aprop.

Objaprop_l_default (Obj *(*objgetter)(int))
 Default value for Lisp aprop.

int gvar_i_default (int(*intgetter)(void))
 Default value for integer gvar.

char * gvar_s_default (char *(*strgetter)(void))
 Default value for string gvar.

Objgvar_l_default (Obj *(*objgetter)(void))
 Default value for Lisp gvar.

Objg_synth_methods_default (void)

Variables

short numutypes
 Number of Unit types.

short nummtypes
 Number of Material types.

short numttypes
 Number of Terrain types.

short numatypes
 Number of Advance types.

Globals globals
 Global data variable.

Utypeutypes
 Unit type properties.

Mtypemtypes
 Material type properties.

Ttypettypes
 Terrain type properties.

Atypeatypes
 Advance type properties.

PropertyDefn utypedefns []
 Array of Unit type property definitions.

PropertyDefn mtypedefns []
 Array of Material type property definitions.

PropertyDefn ttypedefns []
 Array of Terrain type property definitions.

PropertyDefn atypedefns []
 Array of Advance type property definitions.

TableDefn tabledefns []
 Array of table definitions.

VarDefn vardefns []
 Array of variable definitions.

short canaddutype
 Can add Unit type flag.

short canaddmtype
 Can add Material type flag.

short canaddttype
 Can add Terrain type flag.

short canaddatype
 Can add Advance type flag.

short tmputype
 Temporary Unit type.

short tmpmtype
 Temporary Material type.

short tmpttype
 Temporary Terrain type.

short tmpatype
 Temporary Advance type.

int numcelltypes
 Number of cell types.

int numbordtypes
 Number of border types.

int numconntypes
 Number of connection types.

int numcoattypes
 Number of coating types.

short first_auxt_type
 Head of aux terrain type list.

short * next_auxt_type
 Next aux terrain type in list.

short first_bord_type
 Head of border type list.

short * next_bord_type
 Next border type in list.

short first_conn_type
 Head of connection type list.

short * next_conn_type
 Next connection type in list.

int * tmp_u_array
 Tempoary Unit type array.

int * tmp_u2_array
 More utype scratch space.

int * tmp_t_array
 Tempoary Terrain type array.

int * tmp_m_array
 Tempoary Material type array.

int * tmp_a_array
 Tempoary Advance type array.

int ** tmp_uu_array
 Scratch space in the likeness of a TableUU.


Detailed Description

Interface between game parameters and the rest of Xconq.

This file defines the structures that are filled in with type info, one for each type, plus the declarations for all functions and variables.


Define Documentation

#define actor  )     (u_acp(u) > 0)
 

Is actor?

Is the Unit ACP greater than 0?

See also:
u_acp.
Todo:
reanme to u_actor or actor_type?
Parameters:
u is a Unit type.
Returns:
  • FALSE if the ACP of the is less than 1,
  • TRUE otherwise.

#define BACKTTYPE   (-2)
 

Bogus window background terrain.

Used in interfaces for bogus terrain outside the map when redrawing the window background.

#define base_builder  )     (u_is_base_builder((u)->type))
 

Is the Unit a base builder?

Check to see the the type of the Unit is a base builder.

See also:
u_is_base_builder.
Parameters:
u is a pointer to a Unit.
Returns:
  • TRUE if the type of the is a base builder type;
  • FALSE otherwise.

#define checka  )     if ((x) < 0 || (x) >= numatypes) atype_error(x);
 

Check Advance type range.

If the Advance type is out of range, call atype_error().

See also:
numatypes, atype_error.
Parameters:
x is the Advance type.

#define checkm  )     if ((x) < 0 || (x) >= nummtypes) mtype_error(x);
 

Check Material type range.

If the Material type is out of range, call mtype_error().

See also:
nummtypes, mtype_error.
Parameters:
x is the Terrain type.

#define checkt  )     if ((x) < 0 || (x) >= numttypes) ttype_error(x);
 

Check Terrain type range.

If the Terrain type is out of range, call ttype_error().

See also:
numttypes, ttype_error.
Parameters:
x is the Terrain type.

#define checku  )     if ((x) < 0 || (x) >= numutypes) utype_error(x);
 

Check Unit type range.

If the Unit is out of range, call utype_error().

See also:
numutypes, utype_error.
Parameters:
x is the Unit type.

#define could_carry u1,
u2   )     (uu_capacity_x(u1, u2) > 0 || uu_size(u2, u1) <= u_capacity(u1))
 

Unit could carry Unit?

Check to see if a Unit type may carry another Unit type.

See also:
uu_capacity_x, uu_size, u_capacity.
Parameters:
u1 is the transport Unit type.
u2 is the passenger Unit type.
Returns:
  • TRUE if
    • the transport can explictly carry the passenger, or
    • the size of the passenger on the transport is less than the transport's capacity;
  • FALSE otherwise.

#define could_develop u1,
u2   )     (uu_acp_to_develop(u1, u2) > 0)
 

Unit could develop Unit?

Check to see a Unit type can develop a Unit type.

See also:
uu_acp_to_develop.
Parameters:
u1 is the developing Unit type.
u2 is the developed Unit type.
Returns:
  • TRUE if possible;
  • FALSE otherwise.

#define could_live_on u,
 )     (could_be_on(u, t) && !ut_vanishes_on(u, t) && !ut_wrecks_on(u, t))
 

Can Unit survive on Terrain?

Check to see if a Unit type can live on a Terrain type.

See also:
cold_be_on, ut_vanishes_on, ut_wrecks_on.
Parameters:
u is the Unit type.
t is the Terrain type.
Returns:
  • TRUE if
    • the Unit type can be on the Terrain type, and
    • the Unit type won't vanish on the Terrain type, and
    • the Unit type won't wreck on the Terrain type;
  • FALsE otherwise.

#define DEF_AA_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     extern short *TABLE, CNST;
 

#define DEF_AA_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     int FNAME(int a1, int a2);
 

#define DEF_AM_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     extern short *TABLE, CNST;
 

#define DEF_AM_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     int FNAME(int a, int m);
 

#define DEF_APROP_I name,
FNAME,
doc,
slot,
lo,
dflt,
hi   )     int FNAME(int a);
 

#define DEF_APROP_I name,
fname,
doc,
SLOT,
lo,
dflt,
hi   )     short SLOT;
 

#define DEF_APROP_L name,
FNAME,
doc,
slot   )     Obj *FNAME(int a);
 

#define DEF_APROP_L name,
fname,
doc,
SLOT   )     Obj *SLOT;
 

#define DEF_APROP_S name,
FNAME,
doc,
slot,
dflt   )     char *FNAME(int a);
 

#define DEF_APROP_S name,
fname,
doc,
SLOT,
dflt   )     char *SLOT;
 

#define DEF_MM_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     extern short *TABLE, CNST;
 

#define DEF_MM_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     int FNAME(int m1, int m2);
 

#define DEF_MPROP_I name,
FNAME,
doc,
slot,
lo,
dflt,
hi   )     int FNAME(int m);
 

#define DEF_MPROP_I name,
fname,
doc,
SLOT,
lo,
dflt,
hi   )     short SLOT;
 

#define DEF_MPROP_L name,
FNAME,
doc,
slot   )     Obj *FNAME(int m);
 

#define DEF_MPROP_L name,
fname,
doc,
SLOT   )     Obj *SLOT;
 

#define DEF_MPROP_S name,
FNAME,
doc,
slot,
dflt   )     char *FNAME(int m);
 

#define DEF_MPROP_S name,
fname,
doc,
SLOT,
dflt   )     char *SLOT;
 

#define DEF_TM_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     extern short *TABLE, CNST;
 

#define DEF_TM_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     int FNAME(int t, int m);
 

#define DEF_TPROP_I name,
FNAME,
doc,
slot,
lo,
dflt,
hi   )     int FNAME(int t);
 

#define DEF_TPROP_I name,
fname,
doc,
SLOT,
lo,
dflt,
hi   )     short SLOT;
 

#define DEF_TPROP_L name,
FNAME,
doc,
slot   )     Obj *FNAME(int t);
 

#define DEF_TPROP_L name,
fname,
doc,
SLOT   )     Obj *SLOT;
 

#define DEF_TPROP_S name,
FNAME,
doc,
slot,
dflt   )     char *FNAME(int t);
 

#define DEF_TPROP_S name,
fname,
doc,
SLOT,
dflt   )     char *SLOT;
 

#define DEF_TT_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     extern short *TABLE, CNST;
 

#define DEF_TT_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     int FNAME(int t1, int t2);
 

#define DEF_UA_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     extern short *TABLE, CNST;
 

#define DEF_UA_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     int FNAME(int u, int a);
 

#define DEF_UM_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     extern short *TABLE, CNST;
 

#define DEF_UM_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     int FNAME(int u, int m);
 

#define DEF_UPROP_I name,
FNAME,
doc,
slot,
lo,
dflt,
hi   )     int FNAME(int u);
 

doc

#define DEF_UPROP_I name,
fname,
doc,
SLOT,
lo,
dflt,
hi   )     short SLOT; /*!< doc */
 

doc

#define DEF_UPROP_L name,
FNAME,
doc,
slot   )     Obj *FNAME(int u);
 

doc

#define DEF_UPROP_L name,
fname,
doc,
SLOT   )     Obj *SLOT; /*!< doc */
 

doc

#define DEF_UPROP_S name,
FNAME,
doc,
slot,
dflt   )     char *FNAME(int u);
 

doc

#define DEF_UPROP_S name,
fname,
doc,
SLOT,
dflt   )     char *SLOT; /*!< doc */
 

doc

#define DEF_UT_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     extern short *TABLE, CNST;
 

#define DEF_UT_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     int FNAME(int u, int t);
 

#define DEF_UU_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     extern short *TABLE, CNST;
 

#define DEF_UU_TABLE name,
FNAME,
doc,
TABLE,
CNST,
lo,
dflt,
hi,
valtype   )     int FNAME(int u1, int u2);
 

#define DEF_VAR_I str,
FNAME,
SETFNAME,
doc,
var,
lo,
dflt,
hi   )     void SETFNAME(int val);
 

#define DEF_VAR_I str,
FNAME,
SETFNAME,
doc,
var,
lo,
dflt,
hi   )     int FNAME(void);
 

#define DEF_VAR_I name,
fname,
setfname,
doc,
VAR,
lo,
dflt,
hi   )     int VAR;
 

#define DEF_VAR_L str,
FNAME,
SETFNAME,
doc,
var,
dflt   )     void SETFNAME(Obj *val);
 

#define DEF_VAR_L str,
FNAME,
SETFNAME,
doc,
var,
dflt   )     Obj *FNAME(void);
 

#define DEF_VAR_L name,
fname,
setfname,
doc,
VAR,
dflt   )     Obj *VAR;
 

#define DEF_VAR_S str,
FNAME,
SETFNAME,
doc,
var,
dflt   )     void SETFNAME(char *val);
 

#define DEF_VAR_S str,
FNAME,
SETFNAME,
doc,
var,
dflt   )     char *FNAME(void);
 

#define DEF_VAR_S name,
fname,
setfname,
doc,
VAR,
dflt   )     char *VAR;
 

#define DONE   (-2)
 

Advance complete.

Used in advances code, must not overlap with NONATYPE.

#define for_all_advance_types  )     for (v = 0; v < numatypes; ++v)
 

Iterate through all Advance types.

For header to iterate through all Advance types.

Parameters:
v is the Advance iteration variable.

#define for_all_aux_terrain_types  )     for ((t) = first_auxt_type; (t) >= 0; (t) = next_auxt_type[(t)])
 

Iterate through aux terrain types.

Iterate over aux terrain types by using cached array linking each type to the next.

Parameters:
t is the Terrain iteration variable.

#define for_all_border_types  )     for ((t) = first_bord_type; (t) >= 0; (t) = next_bord_type[(t)])
 

Iterate through borders.

Iterate over border types by using a cached array linking each type to the next.

Parameters:
t is the Terrain iteration variable.

#define for_all_connection_types  )     for ((t) = first_conn_type; (t) >= 0; (t) = next_conn_type[(t)])
 

Iterate through connections.

Iterate over connection types by using a cached array linking each type to the next.

Parameters:
t is the Terrain iteration variable.

#define for_all_material_types  )     for (v = 0; v < nummtypes; ++v)
 

Iterate all Material types.

For header to iterate through all Material types.

Parameters:
v is the Material type iteration variable.

#define for_all_terrain_types  )     for (v = 0; v < numttypes; ++v)
 

Iterate through all Terrain types.

For header to iterate through all Terrain types.

Parameters:
v is the Terran iteration variable.

#define for_all_unit_types  )     for (v = 0; v < numutypes; ++v)
 

Iterate all Unit types.

For header to iterate through all Unit types defined.

Parameters:
v is the Unit type iteration variable.

#define impassable u,
x,
 )     (!could_be_on((u)->type, terrain_at((x), (y))))
 

Impassable?

Can unit pass the Terrain at the cell?

See also:
could_be_on, terrain_at.
Parameters:
u is a pointer to a Unit.
x is the x-coordinate of the cell.
y is the y-coordinate of the cell.
Returns:
  • TRUE if the Unit type could not be on the Terrain type at (x,y);
  • FALSE otherwise.

#define is_advance_type  )     ((a) >= 0 && (a) < numatypes)
 

Is the Advance type valid?

Check to see if the Advance type is within the range of Advance types.

See also:
numatypes.
Parameters:
a is the Advance type.
Returns:
  • TRUE if the Advance type is within range;
  • FALSE, otherwise.

#define is_material_type  )     ((m) >= 0 && (m) < nummtypes)
 

Is the Material type valid?

Check to see if the Material type is within the range of Material types.

See also:
nummtypes.
Parameters:
m is the Material type.
Returns:
  • TRUE if the Material type is within range;
  • FALSE, otherwise.

#define is_terrain_type  )     ((t) >= 0 && (t) < numttypes)
 

Is the Terrain type valid?

Check to see if the Terrain type is within the range of Terrain types.

See also:
numttypes.
Parameters:
t is the Terrain type.
Returns:
  • TRUE if the Terrain type is within range;
  • FALSE, otherwise.

#define is_unit_type  )     ((u) >= 0 && (u) < numutypes)
 

Is the Unit type valid?

Check to see if the Unit type is within the range of Unit types.

See also:
numutypes.
Parameters:
u is the Unit type.
Returns:
  • TRUE if the Unit type is withing range;
  • FALSE, otherwise.

#define isbase  )     (u_is_base((u)->type))
 

Is the Unit a base?

Check to see the the type of the Unit is a base.

See also:
u_is_base.
Parameters:
u is a pointer to a Unit.
Returns:
  • TRUE if the type of the is a base type;
  • FALSE otherwise.

#define istransport  )     (u_is_transport((u)->type))
 

Is the Unit a transport?

Check to see the the type of the Unit is a transport.

See also:
u_is_transport.
Parameters:
u is a pointer to a Unit.
Returns:
  • TRUE if the type of the is a transport type;
  • FALSE otherwise.

#define mobile  )     (u_speed(u) > 0)
 

Is mobile?

Is the Unit capable of moving?

See also:
u_speed.
Todo:
rename to u_mobile or moble_type?
Parameters:
u is a Unit type.
Returns:
  • TRUE if the Unit type's speed is greater than 0;
  • FALSE otherwise.

#define NOADVANCE   (-3)
 

No advance.

Used in advances code, must not overlap with NONATYPE, and presumably with DONE, as well.

#define NONATYPE   (-1)
 

non advance.

Guaranteed not to be an Advance type.

#define NONMTYPE   (-1)
 

Non Material.

Guaranteed not to be a Material type.

#define NONTTYPE   (-1)
 

Non terrain.

Guaranteed not to be a Terrain type. Used in interfaces for unseen terrain.

#define NONUTYPE   (-1)
 

Non unit.

Guaranteed not to be a Unit type.

#define PROPHI   32767
 

High property value limit.

#define PROPLO   -32768
 

Low property value limit.

#define t_is_border  )     (t_subtype(t) == bordersubtype)
 

Is the Terrain a border?

Check to see the Terrain subtype is a border.

See also:
t_subtype, bordersubtype.
Parameters:
t is a Terrain type.
Returns:
  • TRUE if the Terrain's subtype is border.
  • FALSE otherwise.

#define t_is_cell  )     (t_subtype(t) == cellsubtype)
 

Is the Terrain a cell?

Check to see the Terrain subtype is a cell.

See also:
t_subtype, cellsubtype.
Parameters:
t is a Terrain type.
Returns:
  • TRUE if the Terrain's subtype is cell.
  • FALSE otherwise.

#define t_is_coating  )     (t_subtype(t) == coatingsubtype)
 

Is the Terrain a coating?

Check to see the Terrain subtype is a coating.

See also:
t_subtype, coatingsubtype.
Parameters:
t is a Terrain type.
Returns:
  • TRUE if the Terrain's subtype is coating.
  • FALSE otherwise.

#define t_is_connection  )     (t_subtype(t) == connectionsubtype)
 

Is the Terrain a connection?

Check to see the Terrain subtype is a connection.

See also:
t_subtype, connectionsubtype.
Parameters:
t is a Terrain type.
Returns:
  • TRUE if the Terrain's subtype is connection.
  • FALSE otherwise.

#define TABDICE1   1
 

Type 1 dice table.

#define TABDICE2   2
 

Type 2 dice table.

#define TABHI   32767
 

High value in table.

#define TABINT   0
 

Integer table.

#define TABLO   -32768
 

Low value in table.

#define u_hp  )     (u_hp_max(u))
 

Unit hit points.

Get the Unit type's maximum hit points.

See also:
u_hp_max.
Parameters:
u is unit type.
Returns:
the maximum hit points for the unit.

#define u_mobile  )     (0 < mp_per_turn_max(u))
 

Is utype mobile?

Todo:
Consider ACP-less or ACP-indep movement. Materials are then the limiting factor and so this macro will no longer suffice.

#define VARHI   2000000000
 

High value for globals.

#define VARLO   -2000000000
 

Low value for globals.


Typedef Documentation

typedef struct atype Atype
 

Advance type properties.

Definition of Advance type properties. Each Advance type property may be a short, a string, or a lisp object.

typedef struct a_globals Globals
 

Global data structure.

The global data can be an int, a string, or a lisp object.

typedef struct mtype Mtype
 

Material type properties.

Definition of Material type properties. Each material type property may be a short, a string, or a lisp object.

typedef struct propertydefn PropertyDefn
 

Property definition.

This is the structure representing info about a property of a type, such as a unit type's maximum speed.

typedef struct tabledefn TableDefn
 

Table definition.

This is the structure with info about a table.

typedef struct ttype Ttype
 

Terrain type properties.

Definition of Terrain type properties. Each terrain type property can be a short, a string, or a lisp object.

typedef struct utype Utype
 

Unit Type Property Value.

Define Unit type structure. Each unit type property may be a short, a string, or a lisp object which is repeated for each unit type. It is used to return GDL property values.

typedef struct vardefn VarDefn
 

Global Variables definition.

This is the structure with that contains global access definitions and variables.


Enumeration Type Documentation

enum terrain_subtype
 

Terrain subtypes.

The four roles for Terrain.

Enumeration values:
cellsubtype  Cell
bordersubtype  Border
connectionsubtype  Connection
coatingsubtype  Coating

enum Typetype
 

Type of types.

Indices for each category of types.

Enumeration values:
UTYP  Unit
MTYP  Material
TTYP  Terrain
ATYP  Advance


Function Documentation

void allocate_table int  tbl,
int  reset
 

short aprop_i_default int(*  intgetter)(int)  ) 
 

Default value for integer aprop.

Obj* aprop_l_default Obj *(*  objgetter)(int)  ) 
 

Default value for Lisp aprop.

char* aprop_s_default char *(*  strgetter)(int)  ) 
 

Default value for string aprop.

void atype_error int  s  ) 
 

int could_be_on int  u,
int  t
 

Could u be on t?

void count_terrain_subtypes void   ) 
 

int create_advance_type void   ) 
 

int create_material_type void   ) 
 

int create_terrain_type void   ) 
 

int create_unit_type void   ) 
 

void default_advance_type int  x  ) 
 

void default_material_type int  x  ) 
 

void default_terrain_type int  x  ) 
 

void default_unit_type int  x  ) 
 

void disallow_more_advance_types void   ) 
 

void disallow_more_material_types void   ) 
 

void disallow_more_terrain_types void   ) 
 

void disallow_more_unit_types void   ) 
 

Obj* g_synth_methods_default void   ) 
 

int gvar_i_default int(*  intgetter)(void)  ) 
 

Default value for integer gvar.

Obj* gvar_l_default Obj *(*  objgetter)(void)  ) 
 

Default value for Lisp gvar.

char* gvar_s_default char *(*  strgetter)(void)  ) 
 

Default value for string gvar.

char* index_type_name int  x  ) 
 

void init_globals void   ) 
 

void init_types void   ) 
 

short mprop_i_default int(*  intgetter)(int)  ) 
 

Default value for integer mprop.

Obj* mprop_l_default Obj *(*  objgetter)(int)  ) 
 

Default value for Lisp mprop.

char* mprop_s_default char *(*  strgetter)(int)  ) 
 

Default value for string mprop.

void mtype_error int  m  ) 
 

int numtypes_from_index_type int  x  ) 
 

int table_default int(*  getter)(int, int)  ) 
 

Default value for table.

short tprop_i_default int(*  intgetter)(int)  ) 
 

Default value for integer tprop.

Obj* tprop_l_default Obj *(*  objgetter)(int)  ) 
 

Default value for Lisp tprop.

char* tprop_s_default char *(*  strgetter)(int)  ) 
 

Default value for string tprop.

void ttype_error int  t  ) 
 

short uprop_i_default int(*  intgetter)(int)  ) 
 

Default value for integer uprop.

Obj* uprop_l_default Obj *(*  objgetter)(int)  ) 
 

Default value for Lisp uprop.

char* uprop_s_default char *(*  strgetter)(int)  ) 
 

Default value for string uprop.

void utype_error int  u  ) 
 


Variable Documentation

PropertyDefn atypedefns[]
 

Array of Advance type property definitions.

Atype* atypes
 

Advance type properties.

short canaddatype
 

Can add Advance type flag.

short canaddmtype
 

Can add Material type flag.

short canaddttype
 

Can add Terrain type flag.

short canaddutype
 

Can add Unit type flag.

short first_auxt_type
 

Head of aux terrain type list.

short first_bord_type
 

Head of border type list.

short first_conn_type
 

Head of connection type list.

Globals globals
 

Global data variable.

PropertyDefn mtypedefns[]
 

Array of Material type property definitions.

Mtype* mtypes
 

Material type properties.

short* next_auxt_type
 

Next aux terrain type in list.

short* next_bord_type
 

Next border type in list.

short* next_conn_type
 

Next connection type in list.

short numatypes
 

Number of Advance types.

int numbordtypes
 

Number of border types.

int numcelltypes
 

Number of cell types.

int numcoattypes
 

Number of coating types.

int numconntypes
 

Number of connection types.

short nummtypes
 

Number of Material types.

short numttypes
 

Number of Terrain types.

short numutypes
 

Number of Unit types.

TableDefn tabledefns[]
 

Array of table definitions.

int* tmp_a_array
 

Tempoary Advance type array.

int* tmp_m_array
 

Tempoary Material type array.

int* tmp_t_array
 

Tempoary Terrain type array.

int* tmp_u2_array
 

More utype scratch space.

int* tmp_u_array
 

Tempoary Unit type array.

int** tmp_uu_array
 

Scratch space in the likeness of a TableUU.

short tmpatype
 

Temporary Advance type.

short tmpmtype
 

Temporary Material type.

short tmpttype
 

Temporary Terrain type.

short tmputype
 

Temporary Unit type.

PropertyDefn ttypedefns[]
 

Array of Terrain type property definitions.

Ttype* ttypes
 

Terrain type properties.

PropertyDefn utypedefns[]
 

Array of Unit type property definitions.

Utype* utypes
 

Unit type properties.

VarDefn vardefns[]
 

Array of variable definitions.


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