My Project
additionalEffect.h
Go to the documentation of this file.
1 #ifndef OSL_ADDITIONAL_EFFECT_H
2 #define OSL_ADDITIONAL_EFFECT_H
3 #include "osl/numEffectState.h"
4 
5 namespace osl
6 {
7  namespace effect_util
8  {
13  {
14  private:
15  static void find(const NumEffectState&, Square target,
16  const PieceVector& direct_effects,
17  PieceVector& black, PieceVector& white);
18  template <int count_max>
19  static int count(const NumEffectState&, Square target,
20  Player attack);
21  public:
26  static bool hasEffect(const NumEffectState&, Square target,
27  Player attack);
28  static bool hasEffectStable(const NumEffectState&, Square target,
29  Player attack);
34  static int count2(const NumEffectState&, Square target,
35  Player attack);
40  static void find(const NumEffectState&, Square target,
41  PieceVector& black, PieceVector& white);
42  static void count(const NumEffectState&, Square target,
43  int& black, int& white);
44  static int count(const NumEffectState& state, Player pl, Square target)
45  {
46  int black, white;
47  count(state, target, black, white);
48  return (pl == BLACK) ? black : white;
49  }
50  };
51  } // namespace effect_util
52  using effect_util::AdditionalEffect;
53 } // namespace osl
54 
55 #endif /* OSL_ADDITIONAL_EFFECT_H */
56 // ;;; Local Variables:
57 // ;;; mode:c++
58 // ;;; c-basic-offset:2
59 // ;;; End:
osl::effect_util::AdditionalEffect::hasEffect
static bool hasEffect(const NumEffectState &, Square target, Player attack)
target に attack の追加利きが一つでもあるか. 相手の影利きが先にある場合は対象としない.
Definition: additionalEffect.cc:5
osl::Square
Definition: basic_type.h:532
osl::effect_util::AdditionalEffect::find
static void find(const NumEffectState &, Square target, const PieceVector &direct_effects, PieceVector &black, PieceVector &white)
Definition: additionalEffect.cc:50
osl::effect_util::AdditionalEffect
追加利きを求める
Definition: additionalEffect.h:13
osl::PieceVector
Definition: container.h:305
osl::effect_util::AdditionalEffect::count2
static int count2(const NumEffectState &, Square target, Player attack)
target に attack の追加利きを二つまで数える.
Definition: additionalEffect.cc:43
osl::effect_util::AdditionalEffect::hasEffectStable
static bool hasEffectStable(const NumEffectState &, Square target, Player attack)
Definition: additionalEffect.cc:36
osl::NumEffectState
利きを持つ局面
Definition: numEffectState.h:34
osl::BLACK
@ BLACK
Definition: basic_type.h:9
osl::effect_util::AdditionalEffect::count
static int count(const NumEffectState &state, Player pl, Square target)
Definition: additionalEffect.h:44
osl::effect_util::AdditionalEffect::count
static int count(const NumEffectState &, Square target, Player attack)
Definition: additionalEffect.cc:26
osl::Player
Player
Definition: basic_type.h:8
numEffectState.h
osl
Definition: additionalEffect.h:6