00001
00002
00003 #ifndef OSL_CATEGORY_BREAKTHREATMATE_H
00004 #define OSL_CATEGORY_BREAKTHREATMATE_H
00005
00006 #include "osl/category/categoryEnv.h"
00007 #include "osl/category/categoryTraits.h"
00008 #include "osl/search/simpleHashRecord.h"
00009
00010 namespace osl
00011 {
00012 namespace container
00013 {
00014 class MoveLogProbVector;
00015 }
00016 namespace category
00017 {
00018 using container::MoveLogProbVector;
00019 struct BreakThreatmate : public SpecialProbabilityCategory
00020 {
00021 static const char *getName() { return "BreakThreatmate"; }
00022 static int minProb() { return 100; }
00023 static void generateBreakDrop(int limit,
00024 const NumEffectState&, Position to,
00025 int default_prob, MoveLogProbVector& out);
00026 static void generateOpenRoad(int limit,
00027 const NumEffectState&, Position target,
00028 MoveLogProbVector& out);
00029 static void generateBreak(int limit,
00030 const NumEffectState&, Move,
00031 MoveLogProbVector& out);
00032
00033 static void generate(const CategoryEnv& env, MoveLogProbVector& out) {
00034 const Player turn = env.state->getTurn();
00035 if (! env.record)
00036 return;
00037 const Move threatmate_move = env.record->threatmate().threatmateMove(turn);
00038 if (threatmate_move.isNormal())
00039 generateBreak(env.limit, *env.state, threatmate_move, out);
00040 }
00041 };
00042 }
00043 }
00044
00045
00046 #endif
00047
00048
00049
00050