Generated from galaxy.h with ROBODoc v3.2.2 on Sun Aug 27 19:47:33 2000
TABLE OF CONTENTS
- GalaxyNG/CargoTypes
- GalaxyNG/Cookies
- GalaxyNG/DebugLevels
- GalaxyNG/GameFlags
- GalaxyNG/GroupFlags
- GalaxyNG/LogLevels
- GalaxyNG/PlanetFlags
- GalaxyNG/PlayerFlags
- GalaxyNG/ProductTypes
- GalaxyNG/alliance
- GalaxyNG/battle
- GalaxyNG/bombing
- GalaxyNG/bprotocol
- GalaxyNG/fleetname
- GalaxyNG/game
- GalaxyNG/group
- GalaxyNG/option
- GalaxyNG/participant
- GalaxyNG/planet
- GalaxyNG/planet_claim
- GalaxyNG/player
- GalaxyNG/shiptype
- GalaxyNG/shot
- GalaxyNG/strlist
NAME
CargoTypes
SOURCE
enum {
CG_CAP,
CG_MAT,
CG_COL,
CG_EMPTY,
MAXCARGO
};
NAME
Cookies -- magic cookies used for sanity checks.
SOURCE
#define COOKIEplanet 0x01DFEE01
#define COOKIEgroup 0x02DEEE12
#define COOKIEbattle 0x03DDEE23
#define COOKIEplayer 0x04DCEE34
#define COOKIEalliance 0x05DBEE45
#define COOKIEfleetname 0x06DAEE56
#define COOKIEparticipant 0x07D9EE67
#define COOKIEbatstat 0x08D8EE78
#define COOKIEAplanet 0x09D7EE89
#define COOKIEAalliance 0x0AD6EE9A
#define COOKIEshiptype 0x0BD5EEAB
#define COOKIEbombing 0x0CD4EEBC
#define COOKIEplanet_claim 0x0DD3EECD
#define COOKIEstrlist 0x0ED2EEDE
#define COOKIEgame 0x0FD4EEDF
#define COOKIEgamespecification 0xF1AABEEF
#define COOKIEnewplayer 0xF1EA5747
NAME
DebugLevels --
FUNCTION
DFULL
DWARN
DSTOP
DERR
NAME
GameFlags
SOURCE
/* Game Options Flags */
#define GAME_NONGBOMBING 1
/* planet is bombed completely and does not change owners */
#define GAME_KEEPPRODUCTION 2
/* production already spent is not lost after a switch of production type */
#define GAME_CREATECIRCLE 4
/* Create systems along the edge of a circle. */
#define GAME_NODROP 8
/* Do not drop idle players */
#define GAME_SAVECOPY 16
/* Save a copy of the turn report in /report when running a turn */
NAME
GroupFlags
SOURCE
#define GF_INTERCEPT 1 /* group got intercept order */
#define GF_INBATTLE1 2 /* group took part in a battle in phase 1 */
#define GF_INBATTLE2 4 /* group took part in a battle in phase 2 */
NAME
LogLevels
FUNCTION
LFULL -- Log everything. This creates huge log files.
LPART -- Partial log, used when a turn is ran, messages at this level
end up in the GM report.
LBRIEF -- Be brief. Used during an orders check
LNONE -- Don't log anything.
SEE ALSO
plog()
SOURCE
#define LFULL 3
#define LPART 2
#define LBRIEF 1
#define LNONE 0
NAME
PlanetFlags --
SOURCE
#define PL_VISPREVTURN 1 /* planet was visable the previous turn,
* * * * used by forecast functions */
NAME
PlayerFlags
SOURCE
#define F_ANONYMOUS 1 /* Player want to be anonymous */
#define F_AUTOUNLOAD 2
#define F_PRODTABLE 4
#define F_SORTGROUPS 8
#define F_GROUPFORECAST 16
#define F_PLANETFORECAST 32
#define F_SHIPTYPEFORECAST 64
#define F_ROUTESFORECAST 128
#define F_SORTED 256 /* used by the rateNation function */
#define F_COMPRESS 512 /* Compress turn reports before sending *
* * * * then */
#define F_GPLUS 1024
#define F_MACHINEREPORT 2048 /* Player asks for a "machine" turn report
*
* * * * * * * * 19980620 */
#define F_BATTLEPROTOCOL 4096 /* Include a battle protocol */
#define F_CRLF 8192 /* Make every /n a cr lf */
#define F_XMLREPORT 16384 /* players asks for an xml turn report * *
*
* * * * 19990611 */
#define F_DEAD 32768 /* player is no longer active */
NAME
ProductTypes -- things a planet can produce.
SOURCE
enum {
PR_CAP,
PR_MAT,
PR_SHIP,
PR_DRIVE,
PR_WEAPONS,
PR_SHIELDS,
PR_CARGO
};
NAME
alliance
FUNCTION
Structure to keep track who are part of an alliance.
Can be an element in a standard list.
SOURCE
typedef struct alliance {
struct alliance *next;
long cookie;
char *name;
player *who;
} alliance;
NAME
battle -- battle structure
PURPOSE
Structure to keep track of all battles that took place.
Can be an element in a standard list.
SOURCE
typedef struct battle {
struct battle *next;
long cookie;
char *name;
planet *where;
participant *participants;
bprotocol *protocol;
int phase; /* Either GF_INBATTLE1 or GF_INBATTLE2 */
} battle;
NAME
bombing -- bombing structure
PURPOSE
Structure to keep track of which planets were bombed.
Can be an element in a standard list.
SOURCE
typedef struct bombing {
struct bombing *next;
long cookie;
char *name;
planet *where;
player *owner;
double pop;
double ind;
int producing;
shiptype *producingshiptype;
double cap;
double mat;
double col;
player *who;
alliance *viewers;
} bombing;
NAME
bprotocol --
PURPOSE
Keep track of who fired on who (shot).
SOURCE
typedef struct bprotocol {
long size; /* maximum size */
long cur; /* current size */
shot *shots; /* Array of shots, grows when needed */
} bprotocol;
NAME
fleetname -- name of a fleet and its speed.
PURPOSE
Structure to keep track of all fleet names of a nation.
Can be an element in a standard list.
NOTES
fleetspeed is computed in the fleetphase(), it is not stored
in the turn file. So fleetspeed is incorrect for most of the
time.
SOURCE
typedef struct fleetname {
/* basic list structure */
struct fleetname *next;
long cookie;
char *name;
/* end basic list */
double fleetspeed;
} fleetname;
NAME
game -- game structure
PURPOSE
Entry point to all data for one game.
SOURCE
typedef struct game {
player *next;
long cookie;
char *name;
char *sendmail; /* the command to email a file */
char *GMemail; /* GM reports go to this address */
char *compress; /* the command to compress the body of an
* * * * email */
char *encode; /* the command to encode the compressed *
* * * body */
char *mutt; /* the path to mutt... mutt is good */
char *starttime; /* the time at which a turn is started, *
* * * used for sanity check. */
int turn;
long gameOptions;
player *players; /* list with nations */
planet *planets; /* list with planets */
battle *battles; /* list with battles */
bombing *bombings; /* list with bombings */
strlist *messages; /* list with messages */
double galaxysize;
} game;
NAME
group -- group structure
FUNCTION
Structure to keep track of groups.
ATTRIBUTES
next
cookie
name - unused.
number - group number, used as a name.
type - ship type of the ships in the group.
drive, weapons, shields, cargo - techlevels of the group.
loadtype - type of cargo loaded.
load - the total amount of cargo loaded.
from - planet of origin.
where - destination planet.
To see how these are used see groupLocation()
dist - distance left to destination planet.
ships - quantity of ships (before a battle if any)
left - quantity of ships surviving a battle
flags - see GroupFlags
thefleet - the fleet the group is part of, if any
attack - cached for speed
defense - cached for speed
location - cached for speed
canshoot - array with one element per ship that indicates
if the ship can fire or not.
numberOfAttackers --
numberOfAttackersLeft --
BUGS
The name of this structure is an int, this should be
a char* so we can use the list manipulating functions.
SOURCE
typedef struct group {
struct group *next;
unsigned long cookie;
char *name;
int number;
shiptype *type;
double drive;
double weapons;
double shields;
double cargo;
int loadtype;
double load;
planet *from;
planet *where;
double dist;
int ships;
int left;
long flags;
fleetname *thefleet;
double attack;
double defense;
int *canshoot;
int numberOfAttackers;
int numberOfAttackersLeft;
planet *location;
} group;
NAME
option --
PURPOSE
/
typedef struct option {
char *optionName;
long optionMask;
option;
*****/
NAME
participant -- participant in a battle.
PURPOSE
Structure to keep track of who took part in a battle.
Can be an element in a standard list.
SOURCE
typedef struct participant {
struct participant *next;
long cookie;
char *name;
player *who;
group *groups;
} participant;
NAME
planet --
PURPOSE
Store information about planets.
ATTRIBUTES
inprogress -- Production spent in the last turns, in case
a ship takes several turns to produce.
spent -- production spend on upgrading ships.
SOURCE
typedef struct planet {
/* basic list structure */
struct planet *next;
long cookie;
char *name;
/* end basic list */
player *owner;
double x, y;
double size;
double resources;
double pop;
double ind;
int producing;
shiptype *producingshiptype;
double cap;
double mat;
double col;
double inprogress; /* Production spent in the last turns */
double spent;
struct planet *routes[MAXCARGO];
long flags;
} planet;
NAME
planet_claim
PURPOSE
Structure to keep track which planets a nation claims.
SOURCE
typedef struct planet_claim {
struct planet_claim *next;
long cookie;
char *name;
struct planet *planet_claimed;
} planet_claim;
NAME
player --
PURPOSE
Stores information about a nation and the person that plays it.
BUGS
This should be called nation!
ATTRIBUTES
unused2, unused3, unused4, unused5
-- For future expansion.
masslost -- total amount of ship mass lost since turn 0.
massproduced -- total amount of ship mass produces since turn 0.
rating -- Used for the high score list.
SOURCE
struct player {
player *next;
long cookie;
char *name;
char *addr;
char *pswd;
int pswdstate;
double drive;
double weapons;
double shields;
double cargo;
fleetname *fleetnames;
shiptype *shiptypes;
alliance *allies;
group *groups;
double mx, my, msize;
char *realName; /* For in the Hall of Fame */
int unused2; /* For future expansion */
int unused3; /* For future expansion */
int unused4; /* For future expansion */
int unused5; /* For future expansion */
double masslost;
double massproduced;
int lastorders;
long flags;
strlist *orders;
strlist *messages;
strlist *mistakes;
planet_claim *claimed_planets;
double totPop; /* Cache */
double totInd; /* Cache */
int numberOfPlanets; /* Cache */
int rating; /* Used for the high score list */
};
NAME
shiptype -- design of a ship.
PURPOSE
Structure to keep track of all shiptypes of a nation.
Can be an element in a standard list.
SOURCE
typedef struct shiptype {
/* basic list structure */
struct shiptype *next;
long cookie;
char *name;
/* end basic list */
double drive;
int attacks;
double weapons;
double shields;
double cargo;
int flag;
} shiptype;
NAME
shot
PURPOSE
Information about a single shot.
SOURCE
typedef struct shot {
player *attacker;
shiptype *atype;
player *target;
shiptype *ttype;
int result;
} shot;
NAME
strlist --
PURPOSE
Structure to store strings. Used to store orders, mistakes, and
messages.
NOTES
Has a wrong name. Should be called String or so, since it is
an element in a list.
SOURCE
typedef struct strlist {
struct strlist *next;
long cookie;
char *str;
} strlist;