promote_.h
Go to the documentation of this file.
#ifndef OSL_MOVE_GENERATOR_PROMOTE_H
#define OSL_MOVE_GENERATOR_PROMOTE_H
#include "osl/move_generator/move_action.h"
#include "osl/numEffectState.h"
namespace osl
{
namespace move_generator
{
template<Player P,bool NoCapture=true>
class Promote
{
public:
template<class Action, Ptype T>
static void generateMovesPtype(const NumEffectState& state, Action& action);
template<Ptype T>
static void generatePtype(const NumEffectState& state, MoveVector& out)
{
move_action::Store store(out);
generateMovesPtype<move_action::Store,T>(state, store);
}
template<class Action>
static void generateMoves(const NumEffectState& state, Action& action);
static void generate(const NumEffectState& state, MoveVector& out)
{
move_action::Store store(out);
generateMoves(state, store);
}
};
template<bool NoCapture>
struct GeneratePromote
{
template<class Action>
static void generate(Player p, const NumEffectState& state, Action& action)
{
if (p == BLACK)
Promote<BLACK,NoCapture>::generateMoves(state, action);
else
Promote<WHITE,NoCapture>::generateMoves(state, action);
}
};
}
}
#endif /* OSL_MOVE_GENERATOR_PROMOTE_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::MoveVector
Definition container.h:293
osl::NumEffectState
利きを持つ局面
Definition numEffectState.h:34
osl::move_generator::Promote
成る手を生成.
Definition promote_.h:18
osl::move_generator::Promote::generatePtype
static void generatePtype(const NumEffectState &state, MoveVector &out)
Definition promote_.h:23
osl::move_generator::Promote::generate
static void generate(const NumEffectState &state, MoveVector &out)
Definition promote_.h:31
osl::move_generator::Promote::generateMovesPtype
static void generateMovesPtype(const NumEffectState &state, Action &action)
osl::move_generator::Promote::generateMoves
static void generateMoves(const NumEffectState &state, Action &action)
move_action.h
osl::move_generator
Definition addEffectWithEffect.cc:10
osl
Definition additionalEffect.h:6
osl::Player
Player
Definition basic_type.h:8
osl::BLACK
@ BLACK
Definition basic_type.h:9
numEffectState.h
osl::move_action::Store
指手を MoveVector に保管
Definition move_action.h:16
osl::move_generator::GeneratePromote
Player で特殊化した Action でinstantiate すると無駄なので注意．
Definition promote_.h:43
osl::move_generator::GeneratePromote::generate
static void generate(Player p, const NumEffectState &state, Action &action)
Definition promote_.h:45