00001 #ifndef OSL_MOVE_GENERATER_ADD_EFFECT_WITH_EFFECT_H
00002 #define OSL_MOVE_GENERATER_ADD_EFFECT_WITH_EFFECT_H
00003 #include "osl/move_action/concept.h"
00004 #include "osl/state/numEffectState.h"
00005 #include "osl/move_action/store.h"
00006 #include "osl/container/moveVector.h"
00007 #include <boost/static_assert.hpp>
00008
00009 namespace osl
00010 {
00011 namespace move_generator
00012 {
00021 template<class Action>
00022 class AddEffectWithEffect
00023 {
00024 public:
00025 template<Player P,bool isAttackToKing>
00026 static void generate(const NumEffectState& state,Position target,Action& action,bool& hasPawnCheckmate);
00027 template<Player P,bool isAttackToKing>
00028 static void generate(const NumEffectState& state,Position target,Action& action){
00029 bool dummy;
00030 generate<P,isAttackToKing>(state,target,action,dummy);
00031 }
00032 };
00033 struct GenerateAddEffectWithEffect
00034 {
00039 template<bool isAttackToKing>
00040 static void generate(Player player, const NumEffectState& state, Position target,
00041 move_action::Store& store);
00042 template<bool isAttackToKing>
00043 static void generate(Player player,const NumEffectState& state,Position target,MoveVector& out, bool& has_pawn_checkmate) {
00044 move_action::Store store(out);
00045 if(player==BLACK)
00046 AddEffectWithEffect<move_action::Store>::template generate<BLACK,isAttackToKing>(state,target,store,has_pawn_checkmate);
00047 else
00048 AddEffectWithEffect<move_action::Store>::template generate<WHITE,isAttackToKing>(state,target,store,has_pawn_checkmate);
00049 }
00050 template<bool isAttackToKing>
00051 static void generate(Player player,const NumEffectState& state,Position target,MoveVector& out) {
00052 bool dummy;
00053 generate<isAttackToKing>(player,state,target,out,dummy);
00054 }
00055 };
00056 }
00057 }
00058 #endif
00059
00060
00061
00062