Main Page | Class Hierarchy | Class List | File List | Class Members

board.h

00001 #ifndef BOARD_H_
00002 #define BOARD_H_
00003 
00004 #include <cstdlib>
00005 #include <ctime>
00006 #include <iostream>
00007 #include "player.h"
00008 
00010 
00016 class Board
00017 {
00018         private:
00019                 char *checkBoard(int mode); //a private method utilized by checkWin()
00020                 Player player;
00021         protected:
00022                 static char board[3][3]; //the actual board, shared by all objects
00023                 //char otherPlayer; //the other player (if you are x, it is o)
00024         public:
00026 
00029                 Board(char icon, char otherIcon); //player, otherPlayer
00030                 
00032 
00035                 void reset();
00036                 
00038 
00047                 bool makeMove(int space); //make a move. Return true on success, false on failure
00048                 
00050 
00054                 bool checkWin(); //check winner. true on winner, false on loser
00055                 
00057 
00061                 void show() const; //show the board
00062                 
00063                 virtual ~Board();  //not needed at the moment
00064                 
00066 
00070                 bool checkCats() const; //check for a cat's game. tue if cats, false otherwise
00071 };
00072 
00073 #endif //BOARD_H_
00074 
00075 
00076 
00077 

Generated on Thu Jan 19 19:15:21 2006 for TicTacToe by  doxygen 1.4.4