home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / thx / demos / ttt / build / ttt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  1.0 KB  |  56 lines

  1. // -------- ttt.h
  2.  
  3. #ifndef TTT_H
  4. #define TTT_H
  5.  
  6. #include <theatrix.h>
  7. #include "piece.h"
  8. #include "voice.h"
  9.  
  10. class TicTacToe : public SceneryDirector    {
  11.     enum soundclip {
  12.         iwin = 1,
  13.         youwin,
  14.         tie,
  15.         notthere,
  16.         hmm,
  17.         ohno,
  18.         nowwhat
  19.     };
  20.     int play;
  21.     int isover;
  22.     Piece *piece;
  23.     Voice *voice;
  24.     static char board[9];
  25.     static int wins [8][3];
  26.     void display();
  27.     void hide();
  28.     void initialize_play();
  29.     DECLARE_MOUSECURSORS
  30.     void position(int pos);
  31.     void position1() { position(1); }
  32.     void position2() { position(2); }
  33.     void position3() { position(3); }
  34.     void position4() { position(4); }
  35.     void position5() { position(5); }
  36.     void position6() { position(6); }
  37.     void position7() { position(7); }
  38.     void position8() { position(8); }
  39.     void position9() { position(9); }
  40.     void nextmove();
  41.     int canwin(int n);
  42.     int trywin(int n,int *wn);
  43.     int won();
  44.     void say(soundclip);
  45. public:
  46.     TicTacToe();
  47.     ~TicTacToe();
  48.     void update(int square = 0, int piece = 0);
  49. };
  50.  
  51. const int player = 1;
  52. const int computer = 2;
  53.  
  54. #endif
  55.  
  56.