-
Notifications
You must be signed in to change notification settings - Fork 0
/
subBoard.h
40 lines (33 loc) · 972 Bytes
/
subBoard.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
//
// Created by James Briggs on 15/09/15.
//
#ifndef HEX_SUBBOARD_H
#define HEX_SUBBOARD_H
#include <vector>
#include "board.h"
/**
* Data structure representing a subset of the tile positions of
* a hex board and the colour of the piece at each of those positions.
*/
struct SubBoard
{
// 1d coordinates of the empty tiles
std::vector<int> coords;
// tile pieces of the sub_board
std::vector<TileColour> pieces;
};
/**
* Insert the pieces and corresponding tiles of a sub-board
*
* @param sub_board A sub-board of tiles with pieces to be inserted into the Board
* @return board The hex board updated with the positions from the sub-board.
*/
void insertSubBoard(const SubBoard& sub_board, Board& board);
/**
* Create a sub-board from all the empty positions from a hex board.
*
* @param board A hex board
* @return A sub-board of the empty positions in board.
*/
SubBoard getEmptySubBoard(const Board& board);
#endif //HEX_SUBBOARD_H