00001 /* attackDefenceAroundKing.h 00002 */ 00003 #ifndef _ATTACK_DEFENCE_AROUND_KING_MC_H 00004 #define _ATTACK_DEFENCE_AROUND_KING_MC_H 00005 00006 #include "osl/effect_util/neighboring25Direct.h" 00007 #include "osl/state/simpleState.h" 00008 #include "osl/direction.h" 00009 00010 namespace osl 00011 { 00012 namespace move_classifier 00013 { 00022 template <Player P> 00023 struct AttackDefenceAroundKing 00024 { 00025 static bool 00026 isMember(const SimpleState& state, Move move) 00027 { 00028 const PtypeO ptypeO = move.ptypeO(); 00029 Position from = move.to(); 00030 Position king = state.template getKingPosition <P> (); 00031 00032 return Neighboring25Direct::hasEffect(state, ptypeO, from, king); 00033 } 00034 }; 00035 } // namespace move_classifier 00036 00037 } // namespace osl 00038 00039 #endif /* _ATTACK_DEFENCE_AROUND_KING_MC_H */ 00040 // ;;; Local Variables: 00041 // ;;; mode:c++ 00042 // ;;; c-basic-offset:2 00043 // ;;; End: