00001
00002
00003
00004 #include "osl/category/fullWidth.h"
00005 #ifdef NEED_EXTRA_TEMPLATE_INSTANTIATION
00006 # include "osl/category/categoryListUtil.h"
00007 # include "osl/category/categoryListUtil.tcc"
00008 #endif
00009 #include "osl/search/realizationProbability.h"
00010 #include "osl/move_generator/escape_.h"
00011 #include "osl/move_generator/allMoves.h"
00012 #include "osl/move_action/store.h"
00013 #include "osl/container/moveVector.h"
00014
00015 namespace osl
00016 {
00017 namespace category
00018 {
00019 const FixedValueTable
00020 FullWidth::probTable(search::FullWidthMoveProbability::DefaultProb);
00021 #ifdef NEED_EXTRA_TEMPLATE_INSTANTIATION
00022 template void CategoryListUtil::generate<FullWidth>(CategoryEnv const&, MoveLogProbVector&);
00023 #endif
00024 }
00025 }
00026
00027 void osl::category::FullWidth::
00028 generate(const CategoryEnv& env, MoveVector& out)
00029 {
00030 move_action::Store store(out);
00031 const Player turn = env.state->getTurn();
00032 const Piece kingPiece=env.state->getKingPiece(turn);
00033 const Position kingPosition=kingPiece.position();
00034 if (env.state->hasEffectBy(alt(turn), kingPosition))
00035 {
00036 assert(kingPiece == (*env.state).getPieceAt(kingPosition));
00037 if (turn == BLACK)
00038 move_generator::Escape<BLACK,CategoryEnv::effect_state_t,move_action::Store>::
00039 generateMoves(*env.state,kingPiece,store);
00040 else
00041 move_generator::Escape<WHITE,CategoryEnv::effect_state_t,move_action::Store>::
00042 generateMoves(*env.state,kingPiece,store);
00043 }
00044 else
00045 {
00046 move_generator::AllMoves<NumEffectState,move_action::Store>::
00047 generateMoves(env.state->getTurn(),*env.state, store);
00048 }
00049 }
00050
00051
00052
00053
00054
00055
00056