My Project
additionalEffect.h
Go to the documentation of this file.
1#ifndef OSL_ADDITIONAL_EFFECT_H
2#define OSL_ADDITIONAL_EFFECT_H
4
5namespace osl
6{
7 namespace effect_util
8 {
13 {
14 private:
15 static void find(const NumEffectState&, Square target,
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,
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:
利きを持つ局面
Player
Definition basic_type.h:8
@ BLACK
Definition basic_type.h:9
static bool hasEffectStable(const NumEffectState &, Square target, Player attack)
static int count(const NumEffectState &state, Player pl, Square target)
static int count(const NumEffectState &, Square target, Player attack)
static void find(const NumEffectState &, Square target, const PieceVector &direct_effects, PieceVector &black, PieceVector &white)
static bool hasEffect(const NumEffectState &, Square target, Player attack)
target に attack の追加利きが一つでもあるか. 相手の影利きが先にある場合は対象としない.
static int count2(const NumEffectState &, Square target, Player attack)
target に attack の追加利きを二つまで数える.