My Project
escape_.cc
Go to the documentation of this file.
4#ifdef NDEBUG
6#endif
8
10{
11 const size_t first = out.size();
12 {
13 typedef move_action::Store store_t;
14 store_t store(out);
15 const Piece king =state.kingPiece(state.turn());
17 }
18 MoveVector unpromote_moves;
19 const size_t last = out.size();
20 for (size_t i=first; i<last; ++i)
21 {
22 if(out[i].hasIgnoredUnpromote())
23 unpromote_moves.push_back(out[i].unpromote());
24 }
25 out.push_back(unpromote_moves.begin(), unpromote_moves.end());
26}
27
35
36namespace osl
37{
38 // explicit template instantiation
39 namespace move_generator
40 {
41 template class Escape<move_action::Store>;
54 } // namespace move_generator
55} // namespace osl
56// ;;; Local Variables:
57// ;;; mode:c++
58// ;;; c-basic-offset:2
59// ;;; End:
size_t size() const
Definition container.h:243
void push_back(const T &e)
Definition container.h:204
利きを持つ局面
const Piece kingPiece() const
Definition simpleState.h:83
Player turn() const
static void generateKingEscape(const NumEffectState &state, Action &action)
static void generateBlocking(const NumEffectState &state, Piece p, Square to, Square from, Action &action)
Square toにある玉以外の駒pにfromにある駒から王手がかかってい る時に,長い利きの途中に入る手を 生成する(合駒,駒移動). breakThreatmateから直接呼ばれる.
static void generate(const NumEffectState &state, Piece piece, Action &action)
attacker からの利きを逃れる.
static void generateMoves(const NumEffectState &state, Piece piece, Piece attacker, Action &action)
attacker からの利きを逃れる.
static void generateBlockingKing(const NumEffectState &state, Piece p, Square from, Action &action)
玉pにfromにある駒から王手がかかってい る時に,長い利きの途中に入る手を 生成する(合駒,駒移動). breakThreatmateから直接呼ばれる.
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す
Definition basic_type.h:157
@ BLACK
Definition basic_type.h:9
static void generate(const NumEffectState &state, MoveVector &out)
不成の受けも作成
Definition escape_.cc:9
static void generateCheap(const NumEffectState &state, MoveVector &out)
Definition escape_.cc:28
指手を MoveVector に保管
Definition move_action.h:16
static void generate(const NumEffectState &state, Piece piece, Action &a)
Definition escape_.h:145
static void generateCheapKingEscape(const NumEffectState &state, FixedCapacityVector< Move, Capacity > &out)
Definition escape_.h:136