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
8namespace osl
9{
10 namespace move_classifier
11 {
12 template <Player P>
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:
利きを持つ局面
bool hasEffectIf(PtypeO ptypeo, Square attacker, Square target) const
attackerにptypeoの駒がいると仮定した場合にtargetに利きがあるかどうか を stateをupdateしないで確かめる.
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
constexpr Player alt(Player player)
Definition basic_type.h:13
PtypeO newPtypeO(Player player, Ptype ptype)
Definition basic_type.h:211
static bool isMember(const State &state, Ptype ptype, Square, Square to)
Definition directCheck.h:32
static bool isMember(const NumEffectState &state, Ptype ptype, Square to)
Definition directCheck.h:15