forked from nathansttt/hearts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProblemState.h
executable file
·50 lines (42 loc) · 1.2 KB
/
ProblemState.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
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
//#include "random.h"
#include "States.h"
#ifndef _PROBLEMSTATE_H
#define _PROBLEMSTATE_H
/*
* Class Problemstate describes a particular game. It defines the next player,
* the current player, and the state of the game.
*
* A game state should be able to provide an optimized game state for
* a hash table.
*
* If the game supports partition search, getPartition should return a valid
* partition.
*
*/
class ProblemState {
public:
ProblemState();
virtual ~ProblemState();
void addPlayer(Player *p);
void deletePlayers();
Player *getPlayer(int which) const;
int getPlayerNum(Player *) const;
virtual void Reset(int NEWSEED = -1);
virtual void Print(int val = 0) const;
virtual void ApplyMove(Move *move) {}
virtual void UndoMove(Move *move) {}
virtual Move *getMoves() // get moves for next player
{ printf("Can't call virtual ProblemState::Move\n"); exit(1); return 0; }
virtual bool Done() const;
// redefine to use hash table
//virtual HashState *getHashState() { return 0; }
// define to use history heuristic
virtual uint32_t getMoveHash(const Move *m) { return 0; }
private:
Player *searchAgent;
};
#endif