-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Expand file tree
/
Copy pathGame.hpp
More file actions
33 lines (27 loc) · 703 Bytes
/
Game.hpp
File metadata and controls
33 lines (27 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef GAME_HPP
#define GAME_HPP
#include "Board.hpp"
#include "Player.hpp"
class Game {
private:
Board board;
Player* player1;
Player* player2;
Player* currentPlayer;
bool gameOver;
public:
Game(int boardSize = 3);
~Game();
void initializePlayers(const std::string& p1Name, const std::string& p2Name);
void play();
void makeMove(int row, int col);
void switchPlayer();
void displayResult() const;
bool isGameOver() const;
Player* getCurrentPlayer() const;
private:
void computerMove();
std::pair<int, int> findBestMove() const;
int minimax(Board boardState, bool isMax, int depth) const; // pass the board state
};
#endif