3#ifndef MOBILITY_LANCE_MOBILITY_H
4#define MOBILITY_LANCE_MOBILITY_H
44 int count=(P==
BLACK ? pos.
y()-pos1.
y() : pos1.
y()- pos.
y())-1+
45 (state.
pieceAt(pos1).template canMoveOn<P>() ? 1 : 0);
57 return countAll<BLACK>(state,p);
59 return countAll<WHITE>(state,p);
75 return countSafe<BLACK>(state,p);
77 return countSafe<WHITE>(state,p);
Square mobilityOf(Direction d, int num) const
const Square square() const
const Piece pieceAt(Square sq) const
int y() const
将棋としてのY座標を返す.
void countMobilityBoth(const NumEffectState &state, Square pos, Offset o, int &countAll, int &countSafe)
P : 駒pの持ち主 All : countAllを求めるかどうか? Safe : countAllを求めるかどうか? countAll : 利きに関係なく動けるマス countSafe : 相手の利き...
int countMobilitySafe(Player pl, const NumEffectState &state, Square pos, Offset o)
相手の利きがない動けるマスを求める
static int countAll(Player pl, const NumEffectState &state, Piece p)
static int countSafe(const NumEffectState &state, Piece p)
縦方向,相手の利きがない動けるマスを求める
static int countSafe(Player pl, const NumEffectState &state, Piece p)
static void countBoth(const NumEffectState &state, Piece p, int &countAll, int &countSafe)
縦方向, P : 駒pの持ち主 countAll : 利きに関係なく動けるマス countSafe : 相手の利きがない動けるマス 両方を求める
static void countBoth(Player pl, const NumEffectState &state, Piece p, int &countAll, int &countSafe)
static int countAll(const NumEffectState &state, Piece p)
static int countAll(const NumEffectState &state, Square pos, int num)
縦方向,利きに関係なく動けるマスの数