home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 429_01 / chess12 / chessui.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-30  |  1.3 KB  |  42 lines

  1. #if !defined(CHESSUI_HPP)
  2. #define CHESSUI_HPP
  3.  
  4. #include "misc.hpp"
  5. #include "chess.hpp"
  6.  
  7. // highest layer of user interface
  8. class CHESSUSERIFACE
  9.   {
  10.   public:
  11.     // tell user heap memory exhausted
  12.     CLASSMEMBER void outOfMemory(void);
  13.     // initialize user interface, with board in given configuration
  14.     CLASSMEMBER void init(const BOARD &board);
  15.     // tell user the king of the given color is in checkmate
  16.     CLASSMEMBER void mated(PIECECOLOR color);
  17.     // tell user the king of the given color is in stalemate
  18.     CLASSMEMBER void staleMated(PIECECOLOR color);
  19.     // ask user how to move a piece of the given color on the board.
  20.     // display the move and also invoke the doUserMove member function
  21.     // of board for the move.
  22.     CLASSMEMBER BOOL userMove(BOARD &board, PIECECOLOR color);
  23.     // tell the user the player of the given color is thinking about
  24.     // their next move
  25.     CLASSMEMBER void thinkingMessage(PIECECOLOR color);
  26.     // clear the last Message
  27.     CLASSMEMBER void clearMessage(void);
  28.     // display a move that has been selected by the computer.
  29.     // also invokes the doMove member of board for the move.
  30.     CLASSMEMBER BOOL computerMove
  31.       (
  32.     BOARD &board,
  33.     PIECECOLOR color,
  34.     PIECEMOVE &moveInfo
  35.       );
  36.   };
  37.  
  38. // only instance of this class
  39. extern CHESSUSERIFACE ChessUI;
  40.  
  41. #endif
  42.