-
Notifications
You must be signed in to change notification settings - Fork 11
/
boardmatches.h
48 lines (31 loc) · 1000 Bytes
/
boardmatches.h
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
40
41
42
43
44
45
46
47
48
#ifndef __BOARDMATCHES__
#define __BOARDMATCHES__
#include "board.h"
class MoveMatches : public Move {
friend class BoardMatches;
public:
MoveMatches(Token player,int matches_taken);
void print() const override;
Move *deepcopy() const override;
bool compare (const Move& move) const override;
private:
int matches_taken;
};
class BoardMatches : public Board {
public:
explicit BoardMatches(int matches_count=10);
~BoardMatches() override;
Board *deepcopy() const override;
Move *parse_move_string(Token player,const char *string) const override;
void print() const override;
inline bool is_move_valid(const Move &move) const override;
inline bool is_move_valid(const MoveMatches &move) const;
Moves get_possible_moves(Token player) const override;
void play_move(const Move &move) override;
bool play_random_move(Token player) override;
Token check_for_win() const override;
private:
int matches_count;
Token last_player;
};
#endif