-
Notifications
You must be signed in to change notification settings - Fork 0
/
gameBoard.h
41 lines (35 loc) · 983 Bytes
/
gameBoard.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
#pragma once
#include <iostream>
#include <string>
#include <ctime> // Enables use of time() function
#include "main.h"
#include "tile.h"
class GameBoard
{
private:
// Private Data Members
Tile tileArray[9];
int *emptyTiles;
int emptyTilesSize;
int moveNum;
char endState; // w = win, l = lose, d = draw
// Private Helper Functions
void PlaceTile(int tileID, char inputVal);
int CompChooseTileID();
void RemoveEmptyTile(int tileID);
public:
// Public Member Functions
GameBoard();
~GameBoard();
void UserMove(int tileID);
void CompMove();
int CheckWinState();
void PrintNewlines(int lines);
const void PrintGameBoard();
const int GetTileValueAt(int Idx) { return tileArray[Idx].GetValue(); }
const int GetMoveNum() { return moveNum; }
const int GetEndState() { return endState; }
const int GetEmptyTilesSize() { return emptyTilesSize; }
void LogTiles();
void LogEmptyTiles();
};