-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConnectN.h
51 lines (37 loc) · 941 Bytes
/
ConnectN.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
49
50
51
//
// Created by Raunak Anand on 2019-04-30.
//
#ifndef CONNECTN__CONNECTN_H
#define CONNECTN__CONNECTN_H
#include <vector>
#include "Player.h"
#include "Board.h"
#include "Move.h"
namespace ConnectNGame {
class ConnectN {
public:
explicit ConnectN(int length, int breadth, int n); // constructor for ConnectNGame
virtual ~ConnectN() = default; // destructor
void play();
void determineStartingPlayer();
Move getValidMove() const;
const Player &getCurrentPlayer() const;
Player &getCurrentPlayer();
bool isGameOver(int n) const;
bool isGameWon(int n) const;
bool horzWin(int n) const;
bool vertWin(int n) const;
bool leftDiagWin(int n) const;
bool rightDiagWin(int n) const;
// ways to win
bool tie(int n) const;
void changeTurn();
void declareResults(int winVar) const;
private:
Board board;
std::vector<Player> players;
int playerTurn;
int winN;
};
}
#endif //CONNECTN__CONNECTN_H