00001
00002
00003 #ifndef _MOVE_CLASSIFIER_DIRECTCHECK_H
00004 #define _MOVE_CLASSIFIER_DIRECTCHECK_H
00005
00006 #include "osl/ptype.h"
00007 #include "osl/position.h"
00008 #include "osl/player.h"
00009 namespace osl
00010 {
00011 namespace move_classifier
00012 {
00013 template <Player P>
00014 struct DirectCheck
00015 {
00016 template<class State>
00017 static bool isMember(const State& state, Ptype ptype, Position to)
00018 {
00022 assert(!state.template hasEffectBy<P>(state.template getKingPosition<PlayerTraits<P>::opponent>()));
00029 return state.hasEffectFromTo(newPtypeO(P,ptype),to,
00030 state.template getKingPosition<PlayerTraits<P>::opponent>());
00031 }
00032
00033 template<class State>
00034 static bool isMember(const State& state, Ptype ptype, Position , Position to)
00035 {
00036 return isMember(state, ptype, to);
00037 }
00038 };
00039 }
00040 }
00041
00042 #endif
00043
00044
00045
00046