Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
osl
game_playing
gameManager.h
Go to the documentation of this file.
1
/* gameManager.h
2
*/
3
#ifndef GAMEPLAYING_GAMEMANAGER_H
4
#define GAMEPLAYING_GAMEMANAGER_H
5
#include "
osl/misc/carray.h
"
6
#include "
osl/game_playing/timeKeeper.h
"
7
#include "
osl/move.h
"
8
#include <boost/scoped_ptr.hpp>
9
10
namespace
osl
11
{
12
class
Sennichite;
13
namespace
search
14
{
15
struct
MoveWithComment;
16
}
17
namespace
game_playing
18
{
19
class
GameState;
20
class
CsaLogger;
21
class
ComputerPlayer;
22
23
class
GameManager
24
{
25
protected
:
26
CArray<ComputerPlayer*,2>
players
;
27
CArray<bool,2>
computers
;
28
boost::scoped_ptr<GameState>
state
;
29
boost::scoped_ptr<CsaLogger>
logger
;
30
TimeKeeper
time_keeper
;
31
private
:
32
int
byoyomi
;
33
34
ComputerPlayer
*
player
(
Player
turn)
const
35
{
36
return
players
[turn];
37
}
38
public
:
39
struct
EndGame
{};
44
GameManager
(
ComputerPlayer
*black,
ComputerPlayer
*white,
CsaLogger
*
logger
);
45
virtual
~GameManager
();
46
void
load
(
const
char
*csa_filename,
bool
verbose
=
false
);
47
void
setTimeLeft
(
int
black_time,
int
white_time);
48
void
setByoyomi
(
int
seconds) {
byoyomi
= seconds; }
49
50
void
resetLogger
(
CsaLogger
*l);
51
52
void
setComputerPlayer
(
Player
turn,
bool
is_computer);
53
bool
isComputer
(
Player
turn)
const
54
{
55
return
computers
[turn] &&
player
(turn);
56
}
57
61
const
search::MoveWithComment
computeMove
(
int
& consumed);
62
int
eval
(
Player
turn,
Move
m);
63
protected
:
64
const
Sennichite
pushMove
(
const
search::MoveWithComment
&,
int
seconds);
65
void
popMove
();
66
};
67
68
}
// namespace game_playing
69
}
// namespace osl
70
71
#endif
/* _GAMEMANAGER_H */
72
// ;;; Local Variables:
73
// ;;; mode:c++
74
// ;;; c-basic-offset:2
75
// ;;; End:
Generated on Sun Jul 21 2013 13:37:24 by
1.8.4