CHECKDTA.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:3k
源码类别:

Windows编程

开发平台:

Visual C++

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