Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
osl
move_classifier
safeMove.h
Go to the documentation of this file.
1
/* safeMove.h
2
*/
3
#ifndef OSL_MOVE_CLASSIFIER_SAFE_MOVE_H
4
#define OSL_MOVE_CLASSIFIER_SAFE_MOVE_H
5
#include "
osl/move_classifier/kingOpenMove.h
"
6
#include "
osl/move_classifier/classifierTraits.h
"
7
#include "
osl/state/numEffectState.h
"
8
namespace
osl
9
{
10
namespace
move_classifier
11
{
16
template
<Player P>
17
struct
SafeMove
18
{
19
static
bool
isMember
(
const
NumEffectState& state,
20
Ptype
ptype,
Square
from,
Square
to)
21
{
22
assert(! from.
isPieceStand
());
23
assert(state.pieceOnBoard(from).owner() == P);
28
if
(ptype==
KING
)
29
return
! state.template hasEffectAt<PlayerTraits<P>::opponent>(to);
30
return
!
KingOpenMove<P>::isMember
(state,ptype,from,to);
31
}
32
};
33
34
template
<Player P>
struct
ClassifierTraits
<
SafeMove
<P> >
35
{
36
static
const
bool
drop_suitable
=
false
;
37
static
const
bool
result_if_drop =
true
;
38
};
39
}
40
}
41
#endif
/* OSL_MOVE_CLASSIFIER_SAFE_MOVE_H */
42
// ;;; Local Variables:
43
// ;;; mode:c++
44
// ;;; c-basic-offset:2
45
// ;;; End:
Generated on Sun Jul 21 2013 13:37:26 by
1.8.4