-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathqposinfo.cpp
60 lines (45 loc) · 1.6 KB
/
qposinfo.cpp
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
/*
* Copyright (c) 2005
* Brent Miller and Charles Morrey. All rights reserved.
*
* See the COPYRIGHT_NOTICE file for terms.
*/
#include "qposinfo.h"
IDSTR("$Id: qposinfo.cpp,v 1.5 2006/07/18 06:55:33 bmiller Exp $");
/****/
const qPositionEvaluation positionEval_won_rec =
{ qScore_won, 0, };
const qPositionEvaluation *positionEval_won = &positionEval_won_rec;
const qPositionEvaluation positionEval_lost_rec =
{ qScore_lost, 0, };
const qPositionEvaluation *positionEval_lost = &positionEval_lost_rec;
// Used, for example, in a line of thinking that repeats
const qPositionEvaluation positionEval_even_rec =
{ 0, 0 /* What should the complexity be? */, };
const qPositionEvaluation *positionEval_even = &positionEval_even_rec;
/* I've decided to have even_evaluation's complexity be 0 because, suppose
* every move led to a repeated position--then we'd be stuck with zero
* complexity. Surely, the score of a position in this case should be
* decided by the non-repeating moves.
*/
const qPositionEvaluation positionEval_none_rec =
{ 0, qComplexity_max, };
const qPositionEvaluation *positionEval_none = &positionEval_none_rec;
/*************************
* qPositionInfo members *
*************************/
bool qPositionInfo::evalExists(qPlayer p) const
{
return ((this->getComplexity(p) != qComplexity_max) ||
(this->getScore(p) != 0));
}
bool qPositionInfo::initEval(qPlayer p)
{
this->evaluation[p.getPlayerId()] = positionEval_none_rec;
return TRUE;
}
bool qPositionInfo::initEval()
{
this->evaluation[0] = this->evaluation[1] = positionEval_none_rec;
return TRUE;
}