00001 /* firstMoveThreatmate.tcc 00002 */ 00003 #ifndef SEARCH_FIRSTMOVETHREATMATE_H 00004 #define SEARCH_FIRSTMOVETHREATMATE_H 00005 #include "osl/move.h" 00006 00007 namespace osl 00008 { 00009 namespace search 00010 { 00014 struct FirstMoveThreatmate 00015 { 00016 static bool isMember(Move last_move, Position king) 00017 { 00018 const Ptype captured = last_move.capturePtype(); 00019 const Position to = last_move.to(); 00020 return ((captured != PTYPE_EMPTY) 00021 || (isMajor(last_move.ptype())) 00022 || (abs(to.x() - king.x()) + abs(to.y() - king.y()) < 8)); 00023 } 00024 }; 00025 } 00026 } 00027 00028 #endif /* SEARCH_FIRSTMOVETHREATMATE_H */ 00029 // ;;; Local Variables: 00030 // ;;; mode:c++ 00031 // ;;; c-basic-offset:2 00032 // ;;; End: