説明を見る。00001 #ifndef OSL_GENERATE_ALL_MOVES_TCC
00002 #define OSL_GENERATE_ALL_MOVES_TCC
00003 #include "osl/move_generator/allMoves.h"
00004 #include "osl/move_generator/pieceOnBoard.h"
00005 #include "osl/move_generator/pieceOnBoard.tcc"
00006 #include "osl/move_generator/drop.h"
00007 #include "osl/move_generator/move_action.h"
00008 #include "osl/numEffectState.h"
00009
00010 namespace osl
00011 {
00012 namespace move_generator
00013 {
00014 namespace all_moves
00015 {
00016 template<class Action,Player P,Ptype T>
00017 void
00018 generatePtype(const NumEffectState& state, Action& action){
00019 for(int num=PtypeTraits<T>::indexMin;num<PtypeTraits<T>::indexLimit;++num){
00020 Piece p=state.pieceOf(num);
00021 if(p.isOnBoardByOwner<P>()){
00022 int dummy=0;
00023 if(PtypeTraits<T>::canPromote && p.isPromoted()){
00024 const Ptype PT=PtypeTraits<PtypeFuns<T>::promotePtype >::moveType;
00025 PieceOnBoard<Action>::template generatePtype<P,PT,false>(state,p,action,dummy);
00026 }
00027 else{
00028 PieceOnBoard<Action>::template generatePtype<P,T,false>
00029 (state,p,action,dummy);
00030 }
00031 }
00032 }
00033 }
00034 }
00035 using all_moves::generatePtype;
00039 template<class Action>
00040 template<Player P>
00041 void AllMoves<Action>::
00042 generateOnBoard(const NumEffectState& state, Action& action){
00043 generatePtype<Action,P,PAWN>(state,action);
00044 generatePtype<Action,P,LANCE>(state,action);
00045 generatePtype<Action,P,KNIGHT>(state,action);
00046 generatePtype<Action,P,SILVER>(state,action);
00047 generatePtype<Action,P,GOLD>(state,action);
00048 generatePtype<Action,P,BISHOP>(state,action);
00049 generatePtype<Action,P,ROOK>(state,action);
00050 int dummy=0;
00051 PieceOnBoard<Action>::template generatePtype<P,KING,false>
00052 (state,state.kingPiece<P>(),action,dummy);
00053 }
00057 template<class Action>
00058 template<Player P>
00059 void AllMoves<Action>::
00060 generate(const NumEffectState& state, Action& action){
00061 generateOnBoard<P>(state,action);
00062 Drop<Action>::template generate<P>(state,action);
00063 }
00064
00065
00066 }
00067 }
00068
00069 #endif
00070
00071
00072
00073