-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.hpp
39 lines (29 loc) · 905 Bytes
/
player.hpp
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
34
35
36
37
38
39
#ifndef __PLAYER_H__
#define __PLAYER_H__
#include <iostream>
#include "common.hpp"
#include "board.hpp"
#include <vector>
#include <tuple>
using namespace std;
class Player {
public:
Player(Side s);
~Player();
Move *doMove(Move *opponentsMove, int msLeft);
vector<Move*> getPossibleMoves(Board *theBoard, Side s);
Move *findBestPossibleMove(vector<Move*> possibleMoves, Side s, bool iter);
int computeScore(Move * aMove, Board *theBoard, int total, Side s, bool iter);
int addScoreInDirection(Move *aMove, int dx, int dy, bool mySide);
bool isCornerMove(Move *aMove);
bool isBadMove(Move *aMove);
bool isEdge(Move *aMove);
Side side;
Side otherSide;
Board *board;
vector<Move> mySpaces;
vector<Move> oppSpace;
// Flag to tell if the player is running within the test_minimax context
bool testingMinimax;
};
#endif