3 #ifndef OSL_EVAL_PIECEPAIR_H 4 #define OSL_EVAL_PIECEPAIR_H 28 template<
int Direction,
int Offset>
29 static int sum12One(
const Piece *basePtr,
const int *xbase,
const int *ybase);
31 template<
int Direction,
int Offset>
32 static int adjust12One(
const Piece *basePtr,
const int *xbase1,
const int *ybase1,
const int *xbase2,
const int *ybase2);
60 index_t idx =
index(offset_id, p0, o0, p1, o1);
63 for (
int i=0; i<3; ++i)
64 ret += (idx[i] > 0) ? values.
value(idx[i]) : -values.
value(-idx[i]);
static int value(int offset_id, Piece p, Piece q, const Weights &values)
void fillBW(int index, int dir, Ptype p0, Ptype p1)
static int value(int offset_id, Piece p, Square p1, PtypeO o1, const Weights &values)
static int pieceValue(const NumEffectState &state, Piece p, const Weights &values)
static int sum12One(const Piece *basePtr, const int *xbase, const int *ybase)
void fillSame(int index, int dir, Ptype p0, Ptype p1)
for same owner
static void compile(const Weights &values)
values を展開してクラス全体で使う
static int eval(const NumEffectState &, const Weights &)
int value(size_t index) const
static int valueCompiled(int offset_id, Piece p, Square p1, PtypeO o1)
static int pindex(Player player, Ptype ptype)
PtypeO newPtypeO(Player player, Ptype ptype)
static int value(int offset_id, Square p0, PtypeO o0, Square p1, PtypeO o1, const Weights &values)
static int weight(Player attack, int index, const Weights &values)
static IndexTable plain_table
static CArray< IndexTable, 10 > y_table
static int adjust12(NumEffectState const &state, Square base, PtypeO pos, PtypeO neg)
static int adjust12One(const Piece *basePtr, const int *xbase1, const int *ybase1, const int *xbase2, const int *ybase2)
const Square square() const
PtypeO
Player + Ptype [-15, 15] PtypeO の O は Owner の O.
static int pieceValueDouble(const NumEffectState &state, Piece p, const Weights &)
static int evalWithUpdateCompiled(const NumEffectState &state, Move moved, int last_value)
static CArray< IndexTable, 10 > x_table
static void sanitize(Weights &values)
static int evalWithUpdate(const NumEffectState &state, Move moved, int last_value, const Weights &values)
static index_t index(int offset_id, Piece p, Piece q)
int delta(Player p)
playerにとってちょっと高い値
void fillDiffer(int index, int dir, Ptype p0, Ptype p1)
for different owner
unsigned int ptypeOIndex(PtypeO ptypeo)
static int sum12(NumEffectState const &state, Square base, PtypeO ptypeO)
static const CArray< Offset, 12 > offsets