home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / ARASAN_S.ZIP / CHESS.H < prev    next >
C/C++ Source or Header  |  1994-08-03  |  2KB  |  85 lines

  1. // Copyright 1994 by Jon Dart.  All Rights Reserved.
  2. #ifndef _CHESS_H
  3. #define _CHESS_H
  4.  
  5. #include <wpmain.h>
  6. #include "board.h"
  7. #include "options.h"
  8. #include "search.h"
  9. #include "srclimit.h"
  10. #include "timectrl.h"
  11. #include "log.h"
  12. #include "book.h"
  13. #include "clock.h"
  14. #include "rmove.h"
  15. #include <wpglob.h>
  16. #include <time.h>
  17.  
  18. class Display;
  19.  
  20. APPCLASS Chess : public WPMainWin 
  21. {
  22.     // main application window.
  23.  
  24. public:
  25.     Chess();
  26.     virtual ~Chess();
  27.     void paint(WPPaintStruct &ps);
  28.     BOOL mouse( int msg, WPPoint p, WORD flags );
  29.     BOOL menuInit(WPMenu &menu);
  30.     BOOL command( int id, WORD msg );
  31.     BOOL timer(int id);
  32.     BOOL sized(WPRect &box, WORD how);
  33.     ColorType side_to_move() const
  34.     {
  35.         return current_board.Side();
  36.     }
  37.     
  38.     void write_log(char *msg);
  39. private:
  40.     void reset();
  41.     void compute_move(Board &board, const Time_Info &ti,
  42.         const Boolean background, Search::Statistics &stats,
  43.         ExtendedMove &emove);
  44.     void update_board(const ExtendedMove &emove, 
  45.         const Search::Statistics *stats,
  46.         const Boolean update_log);
  47.  
  48.     void draw_board();
  49.  
  50.     void show_side();
  51.  
  52.     void show_last_move();
  53.  
  54.     void show_last_move( char *move_image );
  55.     
  56.     void computer_plays( const ColorType side );
  57.     
  58.     void setup_clock( const ColorType side);
  59.     void setup_clock_initially();
  60.     
  61.     void update_time();
  62.  
  63.     Board current_board;
  64.     Log log;
  65.     Display *display;
  66.     Search *searcher;
  67.         Search_Limit_Options options;
  68.     Search::Statistics stats;
  69.         Time_Control tc[Max_Time_Controls]; // Time limits
  70.     Time_Info ti[2]; // Holds current time control for each side
  71.     Square start_square; // for move
  72.     ReversibleMove last_move;
  73.     ExtendedMove predicted_move;
  74.     char last_move_image[12];
  75.     Boolean searching;
  76.     Boolean users_move;
  77.     Boolean use_book;
  78.     Boolean no_prev_search;
  79.     Boolean quitting;
  80.     int last_cmd;
  81.     ColorType computer_side;
  82. };
  83.  
  84. #endif
  85.