-
Notifications
You must be signed in to change notification settings - Fork 0
/
State.h
58 lines (48 loc) · 1.71 KB
/
State.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
/******************************************************************
* Name 1 : Cameron Walters
* Name 2 : Payaam Emami
* Name 3 : Itsarapong Sawangsri
* Name 4 : Justin Shelley
* Name 5 : Kenny Nham
* Project Name : Assignment 1
* Due Date : 6/20
* Objectives : Implementing a steepest-ascent/-descent hill-
* : climbing algorithm and A* algorithm to solve
* : the 8-puzzle problem.
*****************************************************************/
#ifndef STATE_H
#define STATE_H
#include "EightGame.h"
/****************************************************************
* State
* ------------------------------------------------------------
* Represents state of a board at a given time, along with their
* heuristic value, with the idea that they be used for the
* queues when implementing the search algorithms.
***************************************************************/
class State {
public:
State();
State(EightGame);
EightGame GetBoardState() { return mCurrentBoard;};
int GetHeuristicValue() {return mHeuristicValue;};
int GetOldMove() {return mOldMove;};
int GetPathValue() {return mPathValue;};
void SetBoard(EightGame xEGBoard);
void SetHeuristicValue(int xHValue);
void SetOldMove(int xDirection) {mOldMove = xDirection;};
void SetPathValue(int xPathValue) {mPathValue = xPathValue;};
void DisplayState();
// Overloaders
State operator=(const State & xRHS);
bool operator==(State & xRHS);
bool operator>(State & xRHS);
private:
const int BOARD_SIZE = 9;
const int BOARD_ROW_SIZE = 3;
EightGame mCurrentBoard;
int mHeuristicValue;
int mPathValue = 0;
int mOldMove;
};
#endif