Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
lib
game_playing
computerPlayer.cc
Go to the documentation of this file.
1
/* computerPlayer.cc
2
*/
3
#include "
osl/game_playing/computerPlayer.h
"
4
#include "
osl/game_playing/gameState.h
"
5
#include "
osl/game_playing/openingBookTracer.h
"
6
#include "
osl/move_generator/legalMoves.h
"
7
#include "
osl/container/moveVector.h
"
8
#include "
osl/misc/random.h
"
9
10
osl::game_playing::
11
ComputerPlayer::~ComputerPlayer
()
12
{
13
}
14
15
bool
osl::game_playing::
16
ComputerPlayer::isReasonableMove
(
const
GameState
&,
Move
,
int
)
17
{
18
return
true
;
19
}
20
21
void
osl::game_playing::
22
ComputerPlayer::allowSpeculativeSearch
(
bool
value)
23
{
24
speculative_search_allowed = value;
25
}
26
27
void
osl::game_playing::
28
ComputerPlayer::setInitialState
(
const
NumEffectState&)
29
{
30
}
31
32
bool
osl::game_playing::
33
ComputerPlayer::stopSearchNow
()
34
{
35
return
true
;
36
}
37
38
void
osl::game_playing::
39
ComputerPlayer::setRootIgnoreMoves
(
const
container::MoveVector
*
/*rim*/
,
bool
)
40
{
41
}
42
43
/* ------------------------------------------------------------------------- */
44
osl::game_playing::
45
ComputerPlayerSelectBestMoveInTime::~ComputerPlayerSelectBestMoveInTime
()
46
{
47
}
48
49
/* ------------------------------------------------------------------------- */
50
51
osl::game_playing::
52
ResignPlayer::~ResignPlayer
()
53
{
54
}
55
56
void
osl::game_playing::
57
ResignPlayer::pushMove
(
Move
)
58
{
59
}
60
void
osl::game_playing::
61
ResignPlayer::popMove
()
62
{
63
}
64
const
osl::search::MoveWithComment
osl::game_playing::
65
ResignPlayer::selectBestMove
(
const
GameState
&,
int
,
int
,
int
)
66
{
67
return
MoveWithComment(Move::INVALID());
68
}
69
70
/* ------------------------------------------------------------------------- */
71
72
osl::game_playing::
73
RandomPlayer::~RandomPlayer
()
74
{
75
}
76
77
void
osl::game_playing::
78
RandomPlayer::pushMove
(
Move
)
79
{
80
}
81
void
osl::game_playing::
82
RandomPlayer::popMove
()
83
{
84
}
85
const
osl::search::MoveWithComment
osl::game_playing::
86
RandomPlayer::selectBestMove
(
const
GameState
& state,
int
,
int
,
int
)
87
{
88
MoveVector
moves
;
89
move_generator::LegalMoves::generate
(state.
state
(),
moves
);
90
if
(moves.empty())
91
return
MoveWithComment(Move::INVALID());
92
return
MoveWithComment(moves[
time_seeded_random
() % moves.size()]);
93
}
94
95
/* ------------------------------------------------------------------------- */
96
// ;;; Local Variables:
97
// ;;; mode:c++
98
// ;;; c-basic-offset:2
99
// ;;; End:
Generated on Sun Jul 21 2013 13:37:23 by
1.8.4