bigramGroup.cc
Go to the documentation of this file.
/* bigramGroup.cc
*/
#include "osl/rating/group/bigramGroup.h"
#include <sstream>
std::string osl::rating::BigramAttackGroup::name(bool same, bool focus_x)
{
std::ostringstream ss;
ss << "BigramA" << (same ? '=' : '!') << (focus_x ? 'X' : 'Y');
return ss.str();
}
osl::rating::BigramAttackGroup::BigramAttackGroup(bool s, bool f)
: Group(name(s, f)), same(s), focus_x(f)
{
for (int x=-2; x<=2; ++x) {
for (int y=-2; y<=2; ++y) {
for (int x2=-2; x2<=2; ++x2) {
for (int y2=-2; y2<=2; ++y2) {
for (int king=0; king<5; ++king) {
push_back(new BigramAttack(x, y, x2, y2, king, same, focus_x));
}
}
}
}
}
}
int osl::rating::BigramAttackGroup::findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
{
const int index = BigramAttack::index(state, move, env, same, focus_x);
return index;
}
/* ------------------------------------------------------------------------- */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
bigramGroup.h
osl::Move
圧縮していない moveの表現 .
Definition basic_type.h:1052
osl::NumEffectState
利きを持つ局面
Definition numEffectState.h:34
osl::rating::BigramAttackGroup::focus_x
bool focus_x
Definition bigramGroup.h:15
osl::rating::BigramAttackGroup::findMatch
int findMatch(const NumEffectState &state, Move m, const RatingEnv &env) const
Definition bigramGroup.cc:29
osl::rating::BigramAttackGroup::same
bool same
Definition bigramGroup.h:15
osl::rating::BigramAttackGroup::BigramAttackGroup
BigramAttackGroup(bool same, bool focus_x)
Definition bigramGroup.cc:13
osl::rating::BigramAttackGroup::name
static std::string name(bool same, bool focus_x)
Definition bigramGroup.cc:6
osl::rating::BigramAttack
Definition bigramAttack.h:13
osl::rating::BigramAttack::index
static int index(const NumEffectState &state, Move move, const RatingEnv &env, bool same, bool focus_x)
Definition bigramAttack.h:50
osl::rating::Group::Group
Group(const std::string &name)
Definition group.cc:15
osl::rating::RatingEnv
Definition ratingEnv.h:16