00001 #ifndef _MOVE_GENERATOR_PROMOTE_H
00002 #define _MOVE_GENERATOR_PROMOTE_H
00003 #include "osl/player.h"
00004 #include "osl/move_action/concept.h"
00005 namespace osl
00006 {
00007 namespace move_generator
00008 {
00015 template<Player P,class State,class Action,bool noCapture=true>
00016 class Promote
00017 {
00018 BOOST_CLASS_REQUIRE(Action,osl::move_action,Concept);
00019 BOOST_STATIC_ASSERT(sizeof(typename State::simple_board_t));
00020 public:
00021 template<Ptype T>
00022 static void generateMovesPtype(const State& state, Action& action);
00023 static void generateMoves(const State& state, Action& action);
00024 };
00025
00026
00030 template<bool NoCapture>
00031 struct GeneratePromote
00032 {
00033 template<class State,class Action>
00034 static void generate(Player p, const State& state, Action& action)
00035 {
00036 if (p == BLACK)
00037 Promote<BLACK,State,Action,NoCapture>::generateMoves(state, action);
00038 else
00039 Promote<WHITE,State,Action,NoCapture>::generateMoves(state, action);
00040 }
00041 };
00042 }
00043 }
00044 #endif
00045
00046
00047
00048