My Project
checkmate.h
Go to the documentation of this file.
1/* checkmate.h
2 */
3#ifndef _CHECKMATE_H
4#define _CHECKMATE_H
5
9
10namespace osl
11{
12 namespace rating
13 {
15 {
16 public:
18 bool match(const NumEffectState& state, Move move, const RatingEnv&) const
19 {
20 return state.hasEffectAt(alt(move.player()), move.to())
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:
圧縮していない moveの表現 .
Player player() const
const Square to() const
利きを持つ局面
bool hasEffectAt(Square target) const
対象とするマスにあるプレイヤーの利きがあるかどうか.
bool match(const NumEffectState &state, Move move, const RatingEnv &) const
Definition checkmate.h:18
bool match(const NumEffectState &state, Move move, const RatingEnv &) const
Definition checkmate.cc:94
static bool isCandidate(const NumEffectState &state, Move move)
Definition checkmate.cc:61
static bool knight2Step(const NumEffectState &state, Move move, Square king)
Definition checkmate.cc:25
static bool captureForKnightCheck(const NumEffectState &state, Move move, Square king)
Definition checkmate.cc:36
constexpr Player alt(Player player)
Definition basic_type.h:13
static bool effectiveAttackCandidate0(const NumEffectState &state, Move move)
depth==0でeffectiveAttackになる可能性がなければfalse
static bool effectiveAttack(NumEffectState &state, Move move, int depth)
move を指した後,alt(move.player())が取ると詰みかどうか.