-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameMap.h
39 lines (32 loc) · 898 Bytes
/
GameMap.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
#pragma once
#include <vector>
#include <algorithm>
using namespace std;
struct Field2 {//èíôîðìàöèÿ î êîîðäèíàòàõ
int x, y;
};
class GameMap
{
private:
int** map;//ìàòðèöà - êàðòà ïîëÿ
Field2 size;//ðàçìåð ïîëÿ
int length;//äëèíà âûèãðûøíîé êîìáèíàöèè
public:
GameMap(); //êîíñòðóêòîð
GameMap(Field2, int);
GameMap(int, int, int);
~GameMap(); //äåñòðóêòîð
bool SetPosition(Field2, int); //çàäàòü ïîçèöèþ
bool IsEmpty(Field2); //ïðîâåðêà ñâîáîäíà ëè ïîçèöèÿ
bool IsEmpty(int, int); //ïðîâåðêà íà ñâîáîäíóþ ÿ÷åéêó
void SetMap(Field2, int);
void SetMap(int, int, int); //ïîëó÷àåì íåêîòîðûå çíà÷åíèÿ êàðòû
int GetValue(int, int);
int GetValue(Field2); //ïîëó÷èòü çíà÷åíèÿ
Field2 GetSize() {
return size;
}
int CheckList(vector<int> a); //ïðîâåðêà êòî ïîáåäèë
int CheckWinner(); //âûèãðàë èëè íåò
bool CanMove(); //åñòü ëè õîäû
};