00001
00002
00003 #ifndef _CATEGORY_DEFENSE_H
00004 #define _CATEGORY_DEFENSE_H
00005
00006 #include "osl/category/categoryTraits.h"
00007 #include "osl/category/ptypePtypeProbTable.h"
00008 #include "osl/category/categoryEnv.h"
00009 #include "osl/move_classifier/blockLongEffect.h"
00010 #include "osl/move_classifier/moveAdaptor.h"
00011
00012 namespace osl
00013 {
00014 namespace category
00015 {
00019 struct AddSupport : public TableProbabilityCategory
00020 {
00021 static Interpolator<PtypePtypeProbTable> probTable;
00022 static const char *getName() { return "AddSupport"; }
00023 struct Test;
00024 static std::pair<bool,size_t>
00025 getIndexIf(const CategoryEnv& env, Move move, int pieceValue);
00026 template <Player P>
00027 static std::pair<bool,size_t>
00028 getIndexIfByPlayer(const CategoryEnv& env, Move move, int pieceValue);
00029 };
00030
00034 struct AddEffectToLastEffect : public StandardProbabilityCategory
00035 {
00036 static Interpolator<PieceValueTable> probTable;
00037 static const char *getName() { return "AddEffectToLastEffect"; }
00038 struct CheckEffect;
00039 static bool isInCategory(const CategoryEnv& env, Move move);
00040 };
00041
00045 struct AntiPromotion : public StandardProbabilityCategory
00046 {
00047 static Interpolator<PieceValueTable> probTable;
00048 static const char *getName() { return "AntiPromotion"; }
00049 struct Test;
00050 static bool isInCategory(const CategoryEnv& env, Move move);
00051 };
00052
00056 struct BlockLong : public StandardProbabilityCategory
00057 {
00058 static Interpolator<PieceValueTable> probTable;
00059 static const char *getName() { return "BlockLong"; }
00060 static bool isInCategory(const CategoryEnv& env, Move move)
00061 {
00062 return move_classifier::PlayerMoveAdaptor<move_classifier::BlockLongAny>
00063 ::isMember(*env.state, move);
00064 }
00065 };
00066 }
00067 }
00068
00069
00070 #endif
00071
00072
00073
00074