3 #ifndef _COUNTEFFECT2_H 4 #define _COUNTEFFECT2_H 16 static const int Max = 2;
24 int attack = 0, defense = 0;
30 if (attack && (attack < Max))
32 if (defense && (defense < Max))
35 return std::make_pair(attack, defense);
39 std::pair<int,int> ad =
count(state, position, env);
40 return attack == ad.first && defense == ad.second;
42 static std::string
name(
int attack,
int defense);
49 std::pair<int,int> ad =
count(state, position, env);
int countEffect(Player player, Square target) const
利きの数を数える.
constexpr Player alt(Player player)
int min(Player p, int v1, int v2)
static bool hasEffect(const NumEffectState &, Square target, Player attack)
target に attack の追加利きが一つでもあるか. 相手の影利きが先にある場合は対象としない. ...
CArray< signed char, Square::SIZE > counteffect2_cache
bool isOnBoard() const
盤面上を表すかどうかの判定. 1<=x() && x()<=9 && 1<=y() && y()<=9 Squareの内部表現に依存する. ...
static int index(const NumEffectState &state, Square position, const RatingEnv &env)
CountEffect2(int a, int d)
unsigned int index() const
bool match(const NumEffectState &state, Square position, const RatingEnv &env) const
static std::string name(int attack, int defense)
static std::pair< int, int > count(const NumEffectState &state, Square position, const RatingEnv &env)