My Project
addEffectWithEffect.h
Go to the documentation of this file.
1 #ifndef OSL_MOVE_GENERATER_ADD_EFFECT_WITH_EFFECT_H
2 #define OSL_MOVE_GENERATER_ADD_EFFECT_WITH_EFFECT_H
4 #include "osl/numEffectState.h"
5 
6 namespace osl
7 {
8  namespace move_generator
9  {
25  template<class Action>
27  {
28  public:
29  template<Player P,bool isAttackToKing>
30  static void generate(const NumEffectState& state,Square target,Action& action,bool& hasPawnCheckmate);
31  template<Player P,bool isAttackToKing>
32  static void generate(const NumEffectState& state,Square target,Action& action){
33  bool dummy;
34  generate<P,isAttackToKing>(state,target,action,dummy);
35  }
36  };
38  {
43  template<bool isAttackToKing>
44  static void generate(Player player, const NumEffectState& state, Square target,
45  move_action::Store& store);
46  template<bool isAttackToKing>
47  static void generate(Player player,const NumEffectState& state,Square target,MoveVector& out, bool& has_pawn_checkmate) {
48  move_action::Store store(out);
49  if(player==BLACK)
50  AddEffectWithEffect<move_action::Store>::template generate<BLACK,isAttackToKing>(state,target,store,has_pawn_checkmate);
51  else
52  AddEffectWithEffect<move_action::Store>::template generate<WHITE,isAttackToKing>(state,target,store,has_pawn_checkmate);
53  }
54  template<bool isAttackToKing>
55  static void generate(Player player,const NumEffectState& state,Square target,MoveVector& out) {
56  bool dummy;
57  generate<isAttackToKing>(player,state,target,out,dummy);
58  }
59  };
60  } // namespace move_generator
61 } // namespace osl
62 #endif /* OSL_MOVE_GENERATER_ADD_EFFECT_WITH_EFFECT_H */
63 // ;;; Local Variables:
64 // ;;; mode:c++
65 // ;;; c-basic-offset:2
66 // ;;; End:
利きを持つ局面
利きをつける手を生成 利きを持つstateでしか使えない.
static void generate(const NumEffectState &state, Square target, Action &action)
static void generate(const NumEffectState &state, Square target, Action &action, bool &hasPawnCheckmate)
Player
Definition: basic_type.h:8
@ BLACK
Definition: basic_type.h:9
指手を MoveVector に保管
Definition: move_action.h:16
static void generate(Player player, const NumEffectState &state, Square target, move_action::Store &store)
対象とするマスに利きを付ける手を生成する.
static void generate(Player player, const NumEffectState &state, Square target, MoveVector &out, bool &has_pawn_checkmate)
static void generate(Player player, const NumEffectState &state, Square target, MoveVector &out)