1 #ifndef OSL_GENERATE_ALL_MOVES_TCC
2 #define OSL_GENERATE_ALL_MOVES_TCC
3 #include "osl/move_generator/allMoves.h"
4 #include "osl/move_generator/pieceOnBoard.h"
5 #include "osl/move_generator/pieceOnBoard.tcc"
6 #include "osl/move_generator/drop.h"
7 #include "osl/move_generator/move_action.h"
8 #include "osl/numEffectState.h"
12 namespace move_generator
16 template<class Action,Player P,Ptype T>
18 generatePtype(const NumEffectState& state, Action& action){
19 for(int num=PtypeTraits<T>::indexMin;num<PtypeTraits<T>::indexLimit;++num){
20 Piece p=state.pieceOf(num);
21 if(p.isOnBoardByOwner<P>()){
23 if(PtypeTraits<T>::canPromote && p.isPromoted()){
24 const Ptype PT=PtypeTraits<PtypeFuns<T>::promotePtype >::moveType;
25 PieceOnBoard<Action>::template generatePtype<P,PT,false>(state,p,action,dummy);
28 PieceOnBoard<Action>::template generatePtype<P,T,false>
29 (state,p,action,dummy);
35 using all_moves::generatePtype;
39 template<class Action>
41 void AllMoves<Action>::
42 generateOnBoard(const NumEffectState& state, Action& action){
43 generatePtype<Action,P,PAWN>(state,action);
44 generatePtype<Action,P,LANCE>(state,action);
45 generatePtype<Action,P,KNIGHT>(state,action);
46 generatePtype<Action,P,SILVER>(state,action);
47 generatePtype<Action,P,GOLD>(state,action);
48 generatePtype<Action,P,BISHOP>(state,action);
49 generatePtype<Action,P,ROOK>(state,action);
51 PieceOnBoard<Action>::template generatePtype<P,KING,false>
52 (state,state.kingPiece<P>(),action,dummy);
57 template<class Action>
59 void AllMoves<Action>::
60 generate(const NumEffectState& state, Action& action){
61 generateOnBoard<P>(state,action);
62 Drop<Action>::template generate<P>(state,action);
66 } // namespace move_generator
69 #endif /* OSL_GENERATE_ALL_MOVES_TCC */
70 // ;;; Local Variables:
72 // ;;; c-basic-offset:2