This repository has been archived by the owner on May 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBoard.h
86 lines (64 loc) · 2.09 KB
/
Board.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
#ifndef ASSIGN2_BOARD_H
#define ASSIGN2_BOARD_H
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include "Coordinate.h"
#define MIN_NORTH -2
#define MIN_SOUTH 2
#define MIN_WEST -2
#define MIN_EAST 2
#define INITIAL_STATE 0
#define ONE_TILE_ADD 1
#define TWO_TILES_ADD 2
#define HORIZONTAL_ADD 3
#define VERTICAL_ADD 4
#define INVALID_ADD 5
class Board {
private:
bool m_qwirkle;
int m_numberOfTileInThisTurn;
int m_orientationOfTileInThisTurn;
std::vector<Coordinate> m_coordinate;
public:
Board();
bool addTileAt(Coordinate &coordinate);
Tile getTileAt(Coordinate coordinate);
int getNorthBound();
int getSouthBound();
int getWestBound();
int getEastBound();
friend std::ostream &operator<<(std::ostream &out, Board &b);
bool hasTileAt(Coordinate coordinate);
bool hasNorth(Coordinate coordinate);
bool hasSouth(Coordinate coordinate);
bool hasWest(Coordinate coordinate);
bool hasEast(Coordinate coordinate);
bool isAddable(Coordinate coordinate);
int numOfNorthTile(Coordinate coordinate);
int numOfSouthTile(Coordinate coordinate);
int numOfWestTile(Coordinate coordinate);
int numOfEastTile(Coordinate coordinate);
int numOfRowTile(Coordinate coordinate);
int numOfColTile(Coordinate coordinate);
int getAddOrientation();
int colPoint(Coordinate coordinate);
int rowPoint(Coordinate coordinate);
int pointWhenPlayerPlaceOneTile();
int pointWhenPlayerPlaceHorizontalTiles();
int pointWhenPlayerPlaceVerticalTiles();
int totalPoint();
void resetValidation();
bool isQwirkle();
std::vector<Tile> colLine();
std::vector<Tile> rowLine();
bool verifyByLine(std::vector<Tile> line);
bool isValidForOneCoordinateCondition();
bool validateSecondTileCondition();
bool validateMoreThanTwoTileCondition();
bool validateHorizontalAdd();
bool validateVerticalAdd();
bool isValsidForMultiplePlaceCondition();
};
#endif // ASSIGN2_BOARD_H