Go to the documentation of this file.00001
00002
00003 #ifndef OSL_MOVE_CLASSIFIER_DIRECTCHECK_H
00004 #define OSL_MOVE_CLASSIFIER_DIRECTCHECK_H
00005
00006 #include "osl/ptype.h"
00007 #include "osl/square.h"
00008 #include "osl/player.h"
00009 namespace osl
00010 {
00011 namespace move_classifier
00012 {
00013 template <Player P>
00014 struct DirectCheck
00015 {
00016 static bool isMember(const NumEffectState& state, Ptype ptype, Square to)
00017 {
00021 assert(!state.template hasEffectAt<P>(state.template kingSquare<PlayerTraits<P>::opponent>()));
00028 return state.hasEffectIf(newPtypeO(P,ptype),to,
00029 state.template kingSquare<PlayerTraits<P>::opponent>());
00030 }
00031
00032 template<class State>
00033 static bool isMember(const State& state, Ptype ptype, Square , Square to)
00034 {
00035 return isMember(state, ptype, to);
00036 }
00037 };
00038 }
00039 }
00040
00041 #endif
00042
00043
00044
00045