00001
00002
00003 #ifndef _GENERATECAPTUREMOVES_TCC
00004 #define _GENERATECAPTUREMOVES_TCC
00005
00006 #include "osl/move_generator/capture_.h"
00007 #include "osl/effect_action/alwaysMove.h"
00008 #include "osl/player.h"
00009
00010 namespace osl
00011 {
00012 namespace move_generator
00013 {
00014 using namespace effect_action;
00015
00016 template<Player P>
00017 template<class State,class Action>
00018 void Capture<P>::
00019 generate(const State& state,Position target,Action& action)
00020 {
00021 AlwaysMove<State,Action> captureAction(state, action);
00022 state.template forEachEffect<P,AlwaysMove<State,Action> >(target,captureAction);
00023 }
00024
00025 template<Player P>
00026 template<class State,class Action>
00027 void Capture<P>::
00028 escapeByCapture(const State& state,Position target,Piece piece,Action& action)
00029 {
00030 AlwaysMove<State,Action> captureAction(state, action);
00031 state.template forEachEffectNotBy<P,AlwaysMove<State,Action> >(target,piece,captureAction);
00032 }
00033
00034 }
00035 }
00036
00037 #endif
00038
00039
00040
00041