00001
00002
00003 #ifndef _GENERATECAPTUREMOVES_H
00004 #define _GENERATECAPTUREMOVES_H
00005
00006 #include "osl/position.h"
00007 #include "osl/player.h"
00008 #include "osl/piece.h"
00009 #include "osl/move_action/concept.h"
00010
00011
00012
00013 namespace osl
00014 {
00015 namespace move_generator
00016 {
00020 template<Player P>
00021 class Capture
00022 {
00023
00024 public:
00028 template<class State,class Action>
00029 static void generate(const State& state,Position target,
00030 Action& action);
00035 template<class State,class Action>
00036 static void escapeByCapture(const State& state,Position target,
00037 Piece piece,Action& action);
00038 };
00039
00044 struct GenerateCapture
00045 {
00046 template<class State,class Action>
00047 static void generate(Player p, const State& state,Position target,
00048 Action& action)
00049 {
00050 if (p == BLACK)
00051 Capture<BLACK>::generate(state,target,action);
00052 else
00053 Capture<WHITE>::generate(state,target,action);
00054 }
00055 template<class State,class Action>
00056 static void escapeByCapture(Player p, const State& state,Position target,
00057 Piece piece,Action& action)
00058 {
00059 if (p == BLACK)
00060 Capture<BLACK>::escapeByCapture(state,target,piece,action);
00061 else
00062 Capture<WHITE>::escapeByCapture(state,target,piece,action);
00063 }
00064 };
00065
00066 }
00067 }
00068
00069
00070 #endif
00071
00072
00073
00074