00001 /* kfendPredictor.cc 00002 */ 00003 #include "osl/threatmate/kfendPredictor.h" 00004 00005 bool osl::threatmate::KfendPredictor::predict(const NumEffectState& state, 00006 const Move move){ 00007 const Player turn = alt(state.getTurn()); 00008 const Position opKingPosition = state.getKingPosition(alt(turn)); 00009 00010 // Capture Piece 00011 if (move.capturePtype()) 00012 return true; 00013 00014 // Add Effect for King's Neighboring8 00015 if ( Neighboring8Direct::hasEffect(state, newPtypeO(turn, move.ptype()), 00016 move.to(), opKingPosition) ) 00017 return true; 00018 return false; 00019 } 00020 00021 // ;;; Local Variables: 00022 // ;;; mode:c++ 00023 // ;;; c-basic-offset:2 00024 // ;;; End: