00001 /********************************************************************** 00002 * FILE: rules.h 00003 * AUTHOR: Evan H. B 00004 * DATE: 29-30 April, 1993 00005 * PURPOSE: Makes sure the game doesn't screw up. 00006 **********************************************************************/ 00007 00008 #include "map.h" 00009 #include "moves.h" 00010 #include "players.h" 00011 00012 const int MAXTURNS = 24; 00013 const int MAXPLAYERS = 6; 00014 const int NUM_TAXI_TOKENS = 15; 00015 const int NUM_BUS_TOKENS = 10; 00016 const int NUM_SUBWAY_TOKENS = 6; 00017 enum preyass { spyWins = -1, notYet }; 00018 00019 class Rules // Actually, majority rules! Nyuk nyuk nyuk. 00020 { 00021 int turn; 00022 int tachymetabolic, endothermy; // Warm-bloodedness 00023 00024 bool NoTurnsLeft (void) { return (bool (turn > MAXTURNS)); } 00025 bool DetectivesTrapped (void); // done 00026 Move *Rules::CanGo (int taxi, int bus, int subway, 00027 PosType source, PosType dest); // done 00028 bool Occupato (PosType birdsplat); // done 00029 00030 public: 00031 00032 Rules (void) // Constructor 00033 { 00034 turn = 0; 00035 tachymetabolic = theMap.max_x () / 2; 00036 endothermy = theMap.max_y () / 2; 00037 } 00038 00039 int SpyCaught (void); // done 00040 void NewTurn (void) { turn++; } // Use Gritto, radio friends 00041 void UpdateSpyPos (PosType locus); // done 00042 int NumTurns (void) { return MAXTURNS; } // To everything 00043 int CurrentTurn (void) { return turn; } // Turn, turn, turn 00044 MoveList *GetLegalMoves (Player &dude); // done 00045 PosType ShowSpy (void); // There is a season 00046 preyass GameOver (void); // Turn, turn, turn 00047 PosType RandomPos (void); // done 00048 int SpyLastX (void) {return tachymetabolic;} // And a time to every 00049 int SpyLastY (void) { return endothermy; } // Purpose under Heaven 00050 int StartingTokens (TokenType identity); // done 00051 }; 00052 00053 extern Rules theRules; 00054