Go to the documentation of this file.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 {
00028 template<class Action>
00029 class AddEffectWithEffect
00030 {
00031 public:
00032 template<Player P,bool isAttackToKing>
00033 static void generate(const NumEffectState& state,Square target,Action& action,bool& hasPawnCheckmate);
00034 template<Player P,bool isAttackToKing>
00035 static void generate(const NumEffectState& state,Square target,Action& action){
00036 bool dummy;
00037 generate<P,isAttackToKing>(state,target,action,dummy);
00038 }
00039 };
00040 struct GenerateAddEffectWithEffect
00041 {
00046 template<bool isAttackToKing>
00047 static void generate(Player player, const NumEffectState& state, Square target,
00048 move_action::Store& store);
00049 template<bool isAttackToKing>
00050 static void generate(Player player,const NumEffectState& state,Square target,MoveVector& out, bool& has_pawn_checkmate) {
00051 move_action::Store store(out);
00052 if(player==BLACK)
00053 AddEffectWithEffect<move_action::Store>::template generate<BLACK,isAttackToKing>(state,target,store,has_pawn_checkmate);
00054 else
00055 AddEffectWithEffect<move_action::Store>::template generate<WHITE,isAttackToKing>(state,target,store,has_pawn_checkmate);
00056 }
00057 template<bool isAttackToKing>
00058 static void generate(Player player,const NumEffectState& state,Square target,MoveVector& out) {
00059 bool dummy;
00060 generate<isAttackToKing>(player,state,target,out,dummy);
00061 }
00062 };
00063 }
00064 }
00065 #endif
00066
00067
00068
00069