3#ifndef MOBILITY_ROOK_MOBILITY_H
4#define MOBILITY_ROOK_MOBILITY_H
36 countVerticalBoth<BLACK>(state,p,countAll,countSafe);
38 countVerticalBoth<WHITE>(state,p,countAll,countSafe);
48 int count=posD.
y()-posU.
y()-2+
49 (state.
pieceAt(posU).template canMoveOn<P>() ? 1 : 0)+
50 (state.
pieceAt(posD).template canMoveOn<P>() ? 1 : 0);
55 return countVerticalAll<P>(state,p.
number());
59 return countVerticalAll<BLACK>(state,p);
61 return countVerticalAll<WHITE>(state,p);
75 return countVerticalSafe<BLACK>(state,p);
77 return countVerticalSafe<WHITE>(state,p);
97 countHorizontalBoth<BLACK>(state,p,countAll,countSafe);
99 countHorizontalBoth<WHITE>(state,p,countAll,countSafe);
107 int count=(posL.
x()-posR.
x()-2)+
108 (state.
pieceAt(posR).template canMoveOn<P>() ? 1 : 0)+
109 (state.
pieceAt(posL).template canMoveOn<P>() ? 1 : 0);
117 return countHorizontalAll<P>(state,p.
number());
121 return countHorizontalAll<BLACK>(state,p);
123 return countHorizontalAll<WHITE>(state,p);
137 return countHorizontalSafe<BLACK>(state,p);
139 return countHorizontalSafe<WHITE>(state,p);
Square mobilityOf(Direction d, int num) const
const Square square() const
const Piece pieceAt(Square sq) const
int y() const
将棋としてのY座標を返す.
int x() const
将棋としてのX座標を返す.
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 countHorizontalAll(Player pl, const NumEffectState &state, Piece p)
static int countHorizontalAll(const NumEffectState &state, int num)
static int countHorizontalSafe(Player pl, const NumEffectState &state, Piece p)
static int countVerticalAll(const NumEffectState &state, int num)
縦方向,利きに関係なく動けるマスの数
static int countHorizontalAll(const NumEffectState &state, Piece p)
横方向,利きに関係なく動けるマスの数
static void countVerticalBoth(const NumEffectState &state, Piece p, int &countAll, int &countSafe)
縦方向, P : 駒pの持ち主 countAll : 利きに関係なく動けるマス countSafe : 相手の利きがない動けるマス 両方を求める
static int countVerticalAll(Player pl, const NumEffectState &state, Piece p)
static void countVerticalBoth(Player pl, const NumEffectState &state, Piece p, int &countAll, int &countSafe)
static void countHorizontalBoth(Player pl, const NumEffectState &state, Piece p, int &countAll, int &countSafe)
static int countVerticalSafe(Player pl, const NumEffectState &state, Piece p)
static int countHorizontalSafe(const NumEffectState &state, Piece p)
横方向,相手の利きがない動けるマスを求める
static int countVerticalSafe(const NumEffectState &state, Piece p)
縦方向,相手の利きがない動けるマスを求める
static void countHorizontalBoth(const NumEffectState &state, Piece p, int &countAll, int &countSafe)
横方向, P : 駒pの持ち主 countAll : 利きに関係なく動けるマス countSafe : 相手の利きがない動けるマス 両方を求める
static int countVerticalAll(const NumEffectState &state, Piece p)