escape_.cc
Go to the documentation of this file.
4 #ifdef NDEBUG
6 #endif
7 #include "osl/numEffectState.h"
8 
10 {
11  const size_t first = out.size();
12  {
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 
29 {
30  if (state.turn() == BLACK)
32  else
34 }
35 
36 namespace osl
37 {
38  // explicit template instantiation
39  namespace move_generator
40  {
41  template class Escape<move_action::Store>;
42  template void Escape<move_action::Store>::generate<BLACK,true,false>(const NumEffectState& state,Piece piece,move_action::Store& action);
43  template void Escape<move_action::Store>::generate<WHITE,true,false>(const NumEffectState& state,Piece piece,move_action::Store& action);
44  template void Escape<move_action::Store>::generateMoves<BLACK,true>(NumEffectState const&, Piece, Piece, move_action::Store&);
45  template void Escape<move_action::Store>::generateMoves<WHITE,true>(NumEffectState const&, Piece, Piece, move_action::Store&);
46  template void Escape<move_action::Store>::generateKingEscape<BLACK, false>(NumEffectState const&, move_action::Store&);
47  template void Escape<move_action::Store>::generateKingEscape<WHITE, false>(NumEffectState const&, move_action::Store&);
48  template void Escape<move_action::Store>::generateKingEscape<BLACK, true>(NumEffectState const&, move_action::Store&);
49  template void Escape<move_action::Store>::generateKingEscape<WHITE, true>(NumEffectState const&, move_action::Store&);
50  template void Escape<move_action::Store>::generateBlockingKing<BLACK,false>(const NumEffectState&,Piece,Square,move_action::Store&);
51  template void Escape<move_action::Store>::generateBlockingKing<WHITE,false>(const NumEffectState&,Piece,Square,move_action::Store&);
52  template void Escape<move_action::Store>::generateBlocking<BLACK,true>(const NumEffectState&,Piece,Square,Square,move_action::Store&);
53  template void Escape<move_action::Store>::generateBlocking<WHITE,true>(const NumEffectState&,Piece,Square,Square,move_action::Store&);
54  } // namespace move_generator
55 } // namespace osl
56 // ;;; Local Variables:
57 // ;;; mode:c++
58 // ;;; c-basic-offset:2
59 // ;;; End:
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す ...
Definition: basic_type.h:157
void push_back(const T &e)
Definition: container.h:204
static void generate(const NumEffectState &state, MoveVector &out)
不成の受けも作成
Definition: escape_.cc:9
move_action::Store store_t
static void generate(const NumEffectState &state, Piece piece, Action &a)
Definition: escape_.h:145
指手を MoveVector に保管
Definition: move_action.h:15
Player turn() const
Definition: simpleState.h:220
利きを持つ局面
size_t size() const
Definition: container.h:243
static void generateCheapKingEscape(const NumEffectState &state, FixedCapacityVector< Move, Capacity > &out)
Definition: escape_.h:136
const Piece kingPiece() const
Definition: simpleState.h:83
static void generateCheap(const NumEffectState &state, MoveVector &out)
Definition: escape_.cc:28