directCheck.h
Go to the documentation of this file.
00001 /* directCheck.h
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 /*from*/, Square to)
00034       {
00035         return isMember(state, ptype, to);
00036       }
00037     };
00038   } // namespace move_classifier
00039 } // namespace osl
00040 
00041 #endif /* _DIRECTCHECK_H */
00042 // ;;; Local Variables:
00043 // ;;; mode:c++
00044 // ;;; c-basic-offset:2
00045 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines