My Project
core
osl
move_generator
promote_.h
Go to the documentation of this file.
1
#ifndef OSL_MOVE_GENERATOR_PROMOTE_H
2
#define OSL_MOVE_GENERATOR_PROMOTE_H
3
#include "
osl/move_generator/move_action.h
"
4
#include "
osl/numEffectState.h
"
5
6
namespace
osl
7
{
8
namespace
move_generator
9
{
16
template
<Player P,
bool
NoCapture=true>
17
class
Promote
18
{
19
public
:
20
template
<
class
Action, Ptype T>
21
static
void
generateMovesPtype
(
const
NumEffectState
& state, Action& action);
22
template
<Ptype T>
23
static
void
generatePtype
(
const
NumEffectState
& state,
MoveVector
& out)
24
{
25
move_action::Store
store(out);
26
generateMovesPtype<move_action::Store,T>(state, store);
27
}
28
template
<
class
Action>
29
static
void
generateMoves
(
const
NumEffectState
& state, Action& action);
30
31
static
void
generate
(
const
NumEffectState
& state,
MoveVector
& out)
32
{
33
move_action::Store
store(out);
34
generateMoves
(state, store);
35
}
36
};
37
41
template
<
bool
NoCapture>
42
struct
GeneratePromote
43
{
44
template
<
class
Action>
45
static
void
generate
(
Player
p,
const
NumEffectState
& state, Action& action)
46
{
47
if
(p ==
BLACK
)
48
Promote<BLACK,NoCapture>::generateMoves
(state, action);
49
else
50
Promote<WHITE,NoCapture>::generateMoves
(state, action);
51
}
52
};
53
}
54
}
55
#endif
/* OSL_MOVE_GENERATOR_PROMOTE_H */
56
// ;;; Local Variables:
57
// ;;; mode:c++
58
// ;;; c-basic-offset:2
59
// ;;; End:
osl::move_generator::Promote::generateMovesPtype
static void generateMovesPtype(const NumEffectState &state, Action &action)
osl::move_generator::Promote::generatePtype
static void generatePtype(const NumEffectState &state, MoveVector &out)
Definition:
promote_.h:23
osl::move_generator::Promote::generateMoves
static void generateMoves(const NumEffectState &state, Action &action)
osl::move_action::Store
指手を MoveVector に保管
Definition:
move_action.h:16
osl::NumEffectState
利きを持つ局面
Definition:
numEffectState.h:34
osl::move_generator::Promote
成る手を生成.
Definition:
promote_.h:18
osl::move_generator::GeneratePromote::generate
static void generate(Player p, const NumEffectState &state, Action &action)
Definition:
promote_.h:45
osl::BLACK
@ BLACK
Definition:
basic_type.h:9
osl::MoveVector
Definition:
container.h:293
osl::Player
Player
Definition:
basic_type.h:8
numEffectState.h
osl::move_generator::GeneratePromote
Player で特殊化した Action でinstantiate すると無駄なので注意.
Definition:
promote_.h:43
move_action.h
osl::move_generator::Promote::generate
static void generate(const NumEffectState &state, MoveVector &out)
Definition:
promote_.h:31
osl
Definition:
additionalEffect.h:6
Generated by
1.8.20