home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / mapi / checkers.frm / checkdta.h < prev    next >
C/C++ Source or Header  |  1996-04-11  |  3KB  |  68 lines

  1. // Some more defines
  2.  
  3. #define PLAYER1         BLACK
  4. #define PLAYER2         RED
  5.  
  6. // Game type definitions
  7.  
  8. #define GAME_CHECKERS   0       
  9. #define GAME_GIVEAWAY   1
  10.  
  11. // Cursor states
  12.  
  13. #define UNDEFINED_CURSOR    -1
  14. #define NORMAL_CURSOR       1
  15. #define RESIZE_CURSOR       2
  16.  
  17. #define RESIZE_RANGE        10      // How far from bottom right should resize
  18.                                     // cursor be shown.
  19.  
  20. // Data structures for Checkers.
  21.  
  22. struct rGameStateRec
  23. {
  24.     int iPlayerTurn;                // Who's turn
  25.     BOOL fPlayAsForm;               // If we are currently a form
  26.     BOOL fInitDone;                 // Game initialization over (when to use timer).
  27.     BOOL fContinuable;              // Is the turn continuable?
  28.     BOOL fSetupMode;                // Game in setup mode? Need for button processing
  29.     BOOL fThinking;                 // Is the computer thinking?
  30.     BOOL fPaused;                   // Is the game paused?
  31.     BOOL fGameInProgress;           // Did the game start? How to react to "File:New"
  32.     BOOL fLMouseButtonDown;         // Is the left mouse button currently down?
  33.     BOOL fRMouseButtonDown;         // Is the right mouse button currently down?
  34.     BOOL fMoveInProgress;           // Is the user in the middle of a move?
  35.     BOOL fComputerBusy;             // Is the computer thinking?
  36.     BOOL fGameOver;                 // Is the game over?
  37.     BOOL fMouseResizeInProgress;    // Is the user resizing the board with the mouse?
  38.     int iCursorState;               // What state is the cursor in (resize, normal?)
  39. };
  40.  
  41. struct rPlayerRec
  42. {
  43.     int iPlayerType;                // (ENUM) Human/Computer/Network
  44.     int iUseOpeningBook;            // (BOOL) Use the opening-book moves
  45.     int iMemPositions;              // (BOOL) Use memorized positions?
  46.     int iUseMoveTheory;             // (BOOL) Use move theory?
  47.     int iUseMoveShuffling;          // (BOOL) Use move shuffling
  48.     int iUseEqualMoveSkipping;      // (BOOL) Use Equal move skipping
  49.     long lUseGoodMoveSkipping;      // (LONG) Use Good move skipping
  50.  
  51.     int iMaxRecursionDepth;             // (LONG) Max recursion depth
  52.     int iUseAlphaBetaPruning;           // (BOOL) Use alpha-beta pruning
  53.     long lAlphaPruningOriginalDepth;    // (LONG) Alpha pruning original depth
  54.     long lAlphaPruningWidth;            // (LONG) Alpha pruning width
  55. };
  56.  
  57. struct rCheckConfigRec
  58. {
  59.     int iGameType;                      // (INT) enum game type (Checkers/FoxGoose)
  60.     int iMustJump;                      // (BOOL) Player must jump when available?
  61.     int iBoardFlipped;                  // (BOOL) Board flipped?
  62.     int iSquareSize;                    // (INT) Size of board square
  63.     int iSetupPurgeBoards;              // (BOOL) Purge boards after setup?
  64.     int iMaxMoves;
  65.  
  66.     struct rPlayerRec   rPlayer[3];       // Config info for players
  67. };
  68.