/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
#ifndef NAT_H
#define NAT_H
-#include "sect.h"
+#include <time.h>
+#include "types.h"
#define MAXNOR 50 /* max # realms */
STAT_GOD /* deity powers */
} nat_status;
-enum { /* Priorities */
- /* sector types are also priorities */
- PRI_SMAINT = SCT_MAXDEF+1, /* ship maintenance */
- PRI_PMAINT, /* plane maintenance */
- PRI_LMAINT, /* land unit maintenance */
- PRI_SBUILD, /* ship building */
- PRI_PBUILD, /* plane building */
- PRI_LBUILD, /* land building */
- PRI_MAX = PRI_LBUILD
-};
-
/*
* TODO
*
* The only user of r_cnum and r_realm appears to be xdump.
* If we had working virtual selectors, we could remove r_cnum and r_realm.
- *
*/
struct realmstr {
- /* initial part must match struct genitem */
+ /* initial part must match struct empobj */
short ef_type;
natid r_cnum; /* country number */
- /* end of part matching struct genitem */
+ /* end of part matching struct empobj */
short r_uid; /* realm table index */
unsigned short r_realm; /* realm number */
short r_xl, r_xh; /* horizontal bounds */
};
struct natstr {
- /* initial part must match struct genitem */
+ /* initial part must match struct empobj */
short ef_type;
natid nat_cnum; /* our country number */
- /* end of part matching struct genitem */
+ /* end of part matching struct empobj */
nat_status nat_stat;
char nat_cnam[20]; /* country name */
char nat_pnam[20]; /* representative */
time_t nat_newstim; /* date news last read */
time_t nat_annotim; /* date annos last read */
float nat_level[4]; /* technology, etc */
- short nat_relate[MAXNOC];
+ unsigned char nat_relate[MAXNOC];
unsigned char nat_contact[MAXNOC];
- short nat_rejects[(MAXNOC + 3) / 4]; /* four bits for each country */
- signed char nat_priorities[PRI_MAX+1]; /* budget priority */
+ unsigned char nat_rejects[MAXNOC];
long nat_flags; /* nation flags */
- char nat_spare[15];
};
/* Update fields. */
/* procedures relating to nation stuff */
-#define putnat(p) ef_write(EF_NATION, n->nat_cnum, (p))
+#define putnat(p) ef_write(EF_NATION, (p)->nat_cnum, (p))
#define getnatp(n) (struct natstr *)ef_ptr(EF_NATION, (n))
#define getrealm(r, n, p) ef_read(EF_REALM, ((r) + ((n) * MAXNOR)), (p))
#define putrealm(p) ef_write(EF_REALM, (p)->r_uid, (p))
extern double tfact(natid cn, double mult);
-extern double tfactfire(natid cn, double mult);
extern double techfact(int level, double mult);
extern char *cname(natid n);