capture_.h
Go to the documentation of this file.
/* capture_.h
*/
#ifndef OSL_MOVE_GENERATOR_CAPTURE_H
#define OSL_MOVE_GENERATOR_CAPTURE_H
#include "osl/move_generator/move_action.h"
#include "osl/numEffectState.h"
namespace osl
{
namespace move_generator
{
template<class Action>
class Capture
{
public:
template<Player P>
static void generate(const NumEffectState& state,Square target,
Action& action);
template<Player P>
static void escapeByCapture(const NumEffectState& state,Square target,
Piece piece,Action& action);
template<Player P>
static void generate1(const NumEffectState& state,Square target,
Action& action);
};
struct GenerateCapture
{
template<class Action>
static void generate(Player p, const NumEffectState& state,Square target,
Action& action)
{
if (p == BLACK)
Capture<Action>::template generate<BLACK>(state,target,action);
else
Capture<Action>::template generate<WHITE>(state,target,action);
}
static void generate(Player P, const NumEffectState& state,Square target,
MoveVector& out)
{
using move_action::Store;
Store store(out);
generate(P, state, target, store);
}
static void generate(const NumEffectState& state,Square target,
MoveVector& out)
{
generate(state.turn(), state, target, out);
}
template<class Action>
static void generate1(Player p, const NumEffectState& state,Square target,
Action& action)
{
if (p == BLACK)
Capture<Action>::template generate1<BLACK>(state,target,action);
else
Capture<Action>::template generate1<WHITE>(state,target,action);
}
static void generate1(Player P, const NumEffectState& state,Square target,
MoveVector& out)
{
using move_action::Store;
Store store(out);
generate1(P, state, target, store);
}
template<class Action>
static void escapeByCapture(Player p, const NumEffectState& state,Square target,
Piece piece,Action& action)
{
if (p == BLACK)
Capture<Action>::template escapeByCapture<BLACK>(state,target,piece,action);
else
Capture<Action>::template escapeByCapture<WHITE>(state,target,piece,action);
}
};
} // namespace move_generator
using move_generator::GenerateCapture;
} // namespace osl
#endif /* OSL_MOVE_GENERATOR_CAPTURE_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::MoveVector
Definition container.h:293
osl::NumEffectState
利きを持つ局面
Definition numEffectState.h:34
osl::Piece
駒.
Definition basic_type.h:788
osl::SimpleState::turn
Player turn() const
Definition simpleState.h:220
osl::Square
Definition basic_type.h:532
osl::move_generator::Capture
駒を取る手を生成
Definition capture_.h:18
osl::move_generator::Capture::generate
static void generate(const NumEffectState &state, Square target, Action &action)
osl::move_generator::Capture::escapeByCapture
static void escapeByCapture(const NumEffectState &state, Square target, Piece piece, Action &action)
osl::move_generator::Capture::generate1
static void generate1(const NumEffectState &state, Square target, Action &action)
取る手を1手だけ作る
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::GenerateCapture
Capture の Player で特殊化できないバージョン．
Definition capture_.h:47
osl::move_generator::GenerateCapture::escapeByCapture
static void escapeByCapture(Player p, const NumEffectState &state, Square target, Piece piece, Action &action)
Definition capture_.h:87
osl::move_generator::GenerateCapture::generate1
static void generate1(Player p, const NumEffectState &state, Square target, Action &action)
Definition capture_.h:70
osl::move_generator::GenerateCapture::generate1
static void generate1(Player P, const NumEffectState &state, Square target, MoveVector &out)
Definition capture_.h:78
osl::move_generator::GenerateCapture::generate
static void generate(Player p, const NumEffectState &state, Square target, Action &action)
Definition capture_.h:49
osl::move_generator::GenerateCapture::generate
static void generate(const NumEffectState &state, Square target, MoveVector &out)
Definition capture_.h:64
osl::move_generator::GenerateCapture::generate
static void generate(Player P, const NumEffectState &state, Square target, MoveVector &out)
Definition capture_.h:57