Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
osl
rating
feature
checkmate.h
Go to the documentation of this file.
1
/* checkmate.h
2
*/
3
#ifndef _CHECKMATE_H
4
#define _CHECKMATE_H
5
6
#include "
osl/rating/feature.h
"
7
#include "
osl/checkmate/immediateCheckmate.h
"
8
#include "
osl/checkmate/checkmateIfCapture.h
"
9
10
namespace
osl
11
{
12
namespace
rating
13
{
14
class
CheckmateIfCapture
:
public
Feature
15
{
16
public
:
17
CheckmateIfCapture
() :
Feature
(
"CC"
) {}
18
bool
match
(
const
NumEffectState& state,
Move
move,
const
RatingEnv
&)
const
19
{
20
return
state.hasEffectAt(
alt
(move.
player
()), move.
to
())
21
&&
checkmate::CheckmateIfCapture::effectiveAttackCandidate0
(state, move)
22
&&
checkmate::CheckmateIfCapture::effectiveAttack
23
(const_cast<NumEffectState&>(state), move, 0);
// XXX: evil cast
24
}
25
};
26
27
class
Threatmate
:
public
Feature
28
{
29
public
:
30
Threatmate
() :
Feature
(
"Tm"
) {}
31
bool
match
(
const
NumEffectState& state,
Move
move,
const
RatingEnv
&)
const
;
32
struct
Helper;
33
34
static
bool
isCandidate
(
const
NumEffectState& state,
Move
move);
35
static
bool
knight2Step
(
const
NumEffectState& state,
Move
move,
Square
king);
36
static
bool
captureForKnightCheck
(
const
NumEffectState& state,
Move
move,
Square
king);
37
};
38
39
}
40
}
41
42
43
#endif
/* _CHECKMATE_H */
44
// ;;; Local Variables:
45
// ;;; mode:c++
46
// ;;; c-basic-offset:2
47
// ;;; End:
Generated on Sun Jul 21 2013 13:37:23 by
1.8.4