00001 /* pass.h 00002 */ 00003 #ifndef CATEGORY_PASS_H 00004 #define CATEGORY_PASS_H 00005 00006 #include "osl/category/categoryTraits.h" 00007 #include "osl/category/categoryEnv.h" 00008 #include "osl/search/simpleHashRecord.h" 00009 #include "osl/container/moveStack.h" 00010 #include "osl/container/moveVector.h" 00011 namespace osl 00012 { 00013 namespace category 00014 { 00018 struct Pass : public SpecialProbabilityCategory 00019 { 00020 static int minProb() { return 30; } // Ŭ 00021 static const char *getName() { return "Pass"; } 00022 static void generate(const CategoryEnv& env, MoveLogProbVector& out) 00023 { 00024 const Player turn = env.state->getTurn(); 00025 if (env.record && env.record->threatmate().maybeThreatmate(turn)) 00026 return; 00027 const bool is_king_in_check 00028 = EffectUtil::isKingInCheck(turn, *env.state); 00029 if (is_king_in_check) 00030 return; 00031 const Move pass = Move::PASS(turn); 00032 const int normal_pass_probability = 200; 00033 const int probability = std::min(normal_pass_probability, env.limit); 00034 out.push_back(MoveLogProb(pass, probability)); 00035 } 00036 }; 00037 } // namespace category 00038 } // namespace osl 00039 00040 #endif /* _PAWN_H */ 00041 // ;;; Local Variables: 00042 // ;;; mode:c++ 00043 // ;;; c-basic-offset:2 00044 // ;;; End: