]> git.pond.sub.org Git - empserver/blobdiff - include/nat.h
Update copyright notice.
[empserver] / include / nat.h
index 4f2618622b9f100c19b330f449e4e43ff83c75fc..13069c407849041d7cd69cc7c02a8320819b9709 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  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
@@ -36,7 +36,8 @@
 #ifndef NAT_H
 #define NAT_H
 
-#include "sect.h"
+#include <time.h>
+#include "types.h"
 
 #define        MAXNOR          50      /* max # realms */
 
@@ -54,17 +55,6 @@ typedef enum {
     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
@@ -73,13 +63,12 @@ enum {                              /* Priorities */
  *
  * 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 */
@@ -88,10 +77,10 @@ struct realmstr {
 };
 
 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 */
@@ -114,12 +103,10 @@ struct natstr {
     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. */
@@ -173,14 +160,13 @@ extern char *relates[];
 
 /* 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);