説明を見る。00001 #ifndef OSL_GENERATE_ALL_MOVES_H
00002 #define OSL_GENERATE_ALL_MOVES_H
00003 #include "osl/numEffectState.h"
00004 #include "osl/move_generator/move_action.h"
00005
00006 namespace osl
00007 {
00008 namespace move_generator
00009 {
00014 template<class Action>
00015 class AllMoves
00016 {
00017 public:
00023 template<Player P>
00024 static void generateOnBoard(const NumEffectState& state, Action& action);
00025
00031 template<Player P>
00032 static void generate(const NumEffectState& state, Action& action);
00033
00034 static void generate(Player p, const NumEffectState& state, Action& action)
00035 {
00036 if(p==BLACK)
00037 generate<BLACK>(state,action);
00038 else
00039 generate<WHITE>(state,action);
00040 }
00041 };
00042
00043 }
00044
00045 struct GenerateAllMoves
00046 {
00047 static void generate(Player p, const NumEffectState& state, MoveVector&);
00048 template <Player P>
00049 static void generate(const NumEffectState& state, MoveVector& out)
00050 {
00051 typedef move_action::Store store_t;
00052 store_t store(out);
00053 move_generator::AllMoves<store_t>::generate<P>(state, store);
00054 }
00055 template <Player P>
00056 static void generateOnBoard(const NumEffectState& state, MoveVector& out)
00057 {
00058 typedef move_action::Store store_t;
00059 store_t store(out);
00060 move_generator::AllMoves<store_t>::generateOnBoard<P>(state, store);
00061 }
00062 };
00063 }
00064
00065 #endif
00066
00067
00068
00069