Change the condition field from an uint with #defines to an enum.
[super-star-trek.git] / src / sst.h
index 07e7a2bc37d3516b143435e31bc7bdd7cd9a16b7..18baff686650abd39c386e7d3627084be2c940ff 100644 (file)
--- a/src/sst.h
+++ b/src/sst.h
@@ -212,6 +212,7 @@ struct game {
        alive,          // we are alive (not killed)
        justin,         // just entered quadrant
        shldup,         // shields are up
+       comhere,        // commander here
        ishere,         // super-commander in quadrant
        ientesc,        // attempted escape from supercommander
        ithere,         // Tholian is here 
@@ -222,7 +223,16 @@ struct game {
        isarmed,        // probe is armed
        inorbit,        // orbiting a planet
        imine,          // mining
+       icrystl,        // dilithium crystals aboard
+       iseenit,        // seen base attack report
        thawed;         // thawed game
+    enum {
+       green = 'G',
+       yellow = 'Y',
+       red = 'R',
+       docked = 'D',
+       dead = 'Z',
+    } condition;               // condition (red/yellow/green/docked)
     int inkling,       // initial number of klingons
        inbase,         // initial number of bases
        incom,          // initial number of commanders
@@ -230,14 +240,12 @@ struct game {
        inrom,          // initial number of commanders
        instar,         // initial stars
        intorps,        // initial/Max torpedoes
-       condit,         // condition (red/yellow/green/docked)
        torps,          // number of torpedoes
        ship,           // ship type -- 'E' is Enterprise
        abandoned,      // count of crew abandoned in space
        length,         // length of game
        skill,          // skill level
        klhere,         // klingons here
-       comhere,        // commanders here
        casual,         // causalties
        nhelp,          // calls for help
        nkinks,         // count of energy-barrier crossings
@@ -251,9 +259,7 @@ struct game {
        isatb,          // =1 if super commander is attacking base
        iscate,         // super commander is here
        iattak,         // attack recursion elimination (was cracks[4])
-       icrystl,        // dilithium crystals aboard
        tourn,          // tournament number
-       iseenit,        // seen base attack report
        proben,         // number of moves for probe
        nprobes;        // number of probes available
     double inresor,    // initial resources
@@ -318,16 +324,10 @@ enum loctype {neither, quadrant, sector};
 #define IHF 'F'
 #define IHT 'T'
 #define IHWEB '#'
-#define IHGREEN 'G'
-#define IHYELLOW 'Y'
-#define IHRED 'R'
-#define IHDOCKED 'D'
-#define IHDEAD 'Z'
 #define IHMATER0 '-'
 #define IHMATER1 'o'
 #define IHMATER2 '0'
 
-
 /* Function prototypes */
 void prelim(void);
 void attack(bool);
@@ -383,10 +383,10 @@ void sortkl(void);
 void imove(void);
 void ram(bool, int, coord);
 void crmena(bool, int, enum loctype, coord w);
-void deadkl(coord, int, int, int);
+void deadkl(coord, int, coord);
 void timwrp(void);
 void movcom(void);
-void torpedo(double, double, int, int, double *, int, int);
+void torpedo(double, double, coord, double *, int, int);
 void huh(void);
 void pause_game(int);
 void nova(coord);
@@ -411,8 +411,8 @@ void probe(void);
 void iostart(void);
 void setwnd(WINDOW *);
 void warble(void);
-void boom(int, int);
-void tracktorpedo(int, int, int, int, int, int);
+void boom(coord);
+void tracktorpedo(coord, int, int, int, int);
 void cgetline(char *, int);
 void waitfor(void);
 void setpassword(void);