Change the condition field from an uint with #defines to an enum.
[super-star-trek.git] / src / sst.h
index 89cb16f69c58261d0f9bdede84062b9f1af2dce4..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 
@@ -223,7 +224,15 @@ struct game {
        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
@@ -231,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
@@ -253,7 +260,6 @@ struct game {
        iscate,         // super commander is here
        iattak,         // attack recursion elimination (was cracks[4])
        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);