My Project
moveAdaptor.h
Go to the documentation of this file.
1/* moveAdaptor.h
2 */
3#ifndef OSL_MOVE_CLASSIFIER_MOVE_ADAPTOR_H
4#define OSL_MOVE_CLASSIFIER_MOVE_ADAPTOR_H
5
8namespace osl
9{
10 namespace move_classifier
11 {
12 template <class Classifier>
14 {
15 static bool isMember(const NumEffectState& state, Move m)
16 {
17 return Classifier::isMember(state, m.ptype(), m.from(), m.to());
18 }
19 };
20
21 template <template <Player> class Classifier>
23 {
24 template <class State>
25 static bool isMember(const State& state, Move m)
26 {
27 assert(m.player() == state.turn());
28 if (state.turn() == BLACK)
29 return Classifier<BLACK>::isMember(state, m.ptype(), m.from(), m.to());
30 else
31 return Classifier<WHITE>::isMember(state, m.ptype(), m.from(), m.to());
32 }
33 };
34
36 template <template <Player> class Classifier>
38 {
39 template <class State>
40 static bool isMember(const State& state, Move m)
41 {
42 if (! ClassifierTraits<Classifier<BLACK> >::drop_suitable
43 && m.isDrop())
44 return ClassifierTraits<Classifier<BLACK> >::result_if_drop;
46 }
47 };
48 } // namespace move_classifier
49} // namespace osl
50
51#endif /* OSL_MOVE_CLASSIFIER_MOVE_ADAPTOR_H */
52// ;;; Local Variables:
53// ;;; mode:c++
54// ;;; c-basic-offset:2
55// ;;; End:
圧縮していない moveの表現 .
Ptype ptype() const
Player player() const
bool isDrop() const
const Square to() const
const Square from() const
利きを持つ局面
@ BLACK
Definition basic_type.h:9
drop の時は呼べないなどの条件を代わりにテスト
Definition moveAdaptor.h:38
static bool isMember(const State &state, Move m)
Definition moveAdaptor.h:40
static bool isMember(const NumEffectState &state, Move m)
Definition moveAdaptor.h:15
static bool isMember(const State &state, Move m)
Definition moveAdaptor.h:25