directCheck.h Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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/ptype.h"
7 #include "osl/square.h"
8 #include "osl/player.h"
9 namespace osl
10 {
11 namespace move_classifier
12 {
13 template <Player P>
14 struct DirectCheck
15 {
16 static bool isMember(const NumEffectState& state, Ptype ptype, Square to)
17 {
21 assert(!state.template hasEffectAt<P>(state.template kingSquare<PlayerTraits<P>::opponent>()));
28 return state.hasEffectIf(newPtypeO(P,ptype),to,
29 state.template kingSquare<PlayerTraits<P>::opponent>());
30 }
31
32 template<class State>
33 static bool isMember(const State& state, Ptype ptype, Square /*from*/, Square to)
34 {
35 return isMember(state, ptype, to);
36 }
37 };
38 } // namespace move_classifier
39 } // namespace osl
40
41 #endif /* _DIRECTCHECK_H */
42 // ;;; Local Variables:
43 // ;;; mode:c++
44 // ;;; c-basic-offset:2
45 // ;;; End: