My Project
directCheck.h
Go to the documentation of this file.
1 /* directCheck.h
2  */
3 #ifndef OSL_MOVE_CLASSIFIER_DIRECTCHECK_H
4 #define OSL_MOVE_CLASSIFIER_DIRECTCHECK_H
5 
6 #include "osl/basic_type.h"
7 
8 namespace osl
9 {
10  namespace move_classifier
11  {
12  template <Player P>
13  struct DirectCheck
14  {
15  static bool isMember(const NumEffectState& state, Ptype ptype, Square to)
16  {
20  assert(!state.template hasEffectAt<P>(state.template kingSquare<alt(P)>()));
27  return state.hasEffectIf(newPtypeO(P,ptype),to,
28  state.template kingSquare<alt(P)>());
29  }
30 
31  template<class State>
32  static bool isMember(const State& state, Ptype ptype, Square /*from*/, Square to)
33  {
34  return isMember(state, ptype, to);
35  }
36  };
37  } // namespace move_classifier
38 } // namespace osl
39 
40 #endif /* _DIRECTCHECK_H */
41 // ;;; Local Variables:
42 // ;;; mode:c++
43 // ;;; c-basic-offset:2
44 // ;;; End:
osl::Square
Definition: basic_type.h:532
osl::move_classifier::DirectCheck::isMember
static bool isMember(const State &state, Ptype ptype, Square, Square to)
Definition: directCheck.h:32
osl::alt
constexpr Player alt(Player player)
Definition: basic_type.h:13
basic_type.h
osl::newPtypeO
PtypeO newPtypeO(Player player, Ptype ptype)
Definition: basic_type.h:211
osl::Ptype
Ptype
駒の種類を4ビットでコード化する
Definition: basic_type.h:84
osl::NumEffectState::hasEffectIf
bool hasEffectIf(PtypeO ptypeo, Square attacker, Square target) const
attackerにptypeoの駒がいると仮定した場合にtargetに利きがあるかどうか を stateをupdateしないで確かめる.
Definition: numEffectState.h:465
osl::move_classifier::DirectCheck::isMember
static bool isMember(const NumEffectState &state, Ptype ptype, Square to)
Definition: directCheck.h:15
osl::NumEffectState
利きを持つ局面
Definition: numEffectState.h:34
osl::move_classifier::DirectCheck
Definition: directCheck.h:14
osl
Definition: additionalEffect.h:6