-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
92 lines (84 loc) · 2.66 KB
/
main.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#include <iostream>
#include <array>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <utility>
#include <tuple>
#include <map>
#include <chrono>
#include <thread>
#include "constantes.h"
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <algorithm>
#include <future>
#include <thread>
#include <fstream>
//#include <random>
using namespace std;
typedef char tab2d[SIZE_COL];
class GameEngine;
void print(vector<array<int,2>> vec);
void print(vector<array<int,2>> vec);
class Board{
tab2d board[SIZE_ROW];
map<char,int> tabL2N;
GameEngine* game;
public:
void display(ostream & out = cout) const;
Board();
void initialize(tab2d* init);
tab2d* boardCopy();
void setGameEngine(GameEngine* ptr);
void convert_coord(int coord[],string m) ;// prend int et un char et on renvoi un tqbaleau de int
string convert_coord_inv(int nc, int nr);
void move(char color, int nc,int nr);
char getCell(int nc, int nr) const;
void countPions(int tab[]);
vector<array<int,2>> wut2flip(char color, int nc,int nr);
const vector<tuple<char,int,int>> getPions(int nc, int nr, int direction);
void flipAll(vector<array<int,2>> coord2flip, int virtuality=0, char color='.');
vector<array<int,2>> whatLegalMoves(char color);
};
class Player{
char type; //H for human or F for file or A for artificial intelligence
char color; //W for white & B for black
string name; //'Skynet' for AI, ask player's name otherwise
public:
char getType() const;
char getColor() const;
string getName() const;
void print(ostream & out = cout) const;