説明を見る。00001 #ifndef OSL_MOVE_GENERATOR_PROMOTE_H
00002 #define OSL_MOVE_GENERATOR_PROMOTE_H
00003 #include "osl/move_generator/move_action.h"
00004 #include "osl/numEffectState.h"
00005
00006 namespace osl
00007 {
00008 namespace move_generator
00009 {
00016 template<Player P,bool NoCapture=true>
00017 class Promote
00018 {
00019 public:
00020 template<class Action, Ptype T>
00021 static void generateMovesPtype(const NumEffectState& state, Action& action);
00022 template<Ptype T>
00023 static void generatePtype(const NumEffectState& state, MoveVector& out)
00024 {
00025 move_action::Store store(out);
00026 generateMovesPtype<move_action::Store,T>(state, store);
00027 }
00028 template<class Action>
00029 static void generateMoves(const NumEffectState& state, Action& action);
00030
00031 static void generate(const NumEffectState& state, MoveVector& out)
00032 {
00033 move_action::Store store(out);
00034 generateMoves(state, store);
00035 }
00036 };
00037
00041 template<bool NoCapture>
00042 struct GeneratePromote
00043 {
00044 template<class Action>
00045 static void generate(Player p, const NumEffectState& state, Action& action)
00046 {
00047 if (p == BLACK)
00048 Promote<BLACK,NoCapture>::generateMoves(state, action);
00049 else
00050 Promote<WHITE,NoCapture>::generateMoves(state, action);
00051 }
00052 };
00053 }
00054 }
00055 #endif
00056
00057
00058
00059