00001 #ifndef OSL_MOVE_GENERATOR_ADD_EFFECT_H
00002 #define OSL_MOVE_GENERATOR_ADD_EFFECT_H
00003 #include "osl/move_generator/drop.h"
00004 #include "osl/move_generator/addEffectTable.h"
00005 #include "osl/move_action/store.h"
00006 #include "osl/container/moveVector.h"
00007 #include <boost/static_assert.hpp>
00008
00009 namespace osl
00010 {
00011 namespace move_generator
00012 {
00016 template<Player P,Ptype T,bool isAttackToKing=false>
00017 struct AddEffectShort
00018 {
00019 BOOST_STATIC_ASSERT((PtypeTraits<T>::isBasic));
00020 BOOST_STATIC_ASSERT((PtypeTraits<T>::canPromote));
00030 template<class Action>
00031 static void generate(const NumEffectState& state,Position target,Action& action,NearMask nearMask);
00032 };
00033
00037 template<Player P,Ptype T,bool isAttackToKing=false>
00038 struct AddEffectLong
00039 {
00040 BOOST_STATIC_ASSERT((PtypeTraits<T>::isBasic));
00044 template<class Action>
00045 static void generate(const NumEffectState& state,Position target,Action& action,NearMask nearMask);
00046 };
00047
00048
00066 template<Player P,bool isAttackToKing=false>
00067 class AddEffect
00068 {
00069
00070 public:
00074 template<class Action>
00075 static void generateKing(const NumEffectState& state,Position target,Action& action,NearMask nearMask);
00076 template<class Action>
00077 static void generateGold(const NumEffectState& state,Position target,Action& action,NearMask nearMask);
00085 template<class Action>
00086 static void generate(const NumEffectState& state,Position target,Action& action);
00087 static void generate(const NumEffectState& state,Position target,MoveVector& out)
00088 {
00089 move_action::Store store(out);
00090 generate(state, target, store);
00091 }
00092 };
00093
00094 template<bool isAttackToKing=false>
00095 struct GenerateAddEffect
00096 {
00102 static void generate(Player player, const NumEffectState& state, Position target,
00103 move_action::Store& store);
00104 static void generate(Player player, const NumEffectState& state, Position target,
00105 MoveVector& out)
00106 {
00107 move_action::Store store(out);
00108 generate(player, state, target, store);
00109 }
00110 };
00111 }
00112 }
00113 #endif
00114
00115
00116
00117