28 int countShort(
PtypeO ptypeO,
int center_dx,
int center_dy){
58 assert(dx!=0 || dy!=0);
62 if(dx_min<=dx*i && dx*i <=dx_max &&
63 dy_min<=dy*i && dy*i <=dy_max)
break;
68 if(!(dx_min<=dx*i && dx*i <=dx_max &&
69 dy_min<=dy*i && dy*i <=dy_max))
break;
98 ret[index]=calcLong(longD,center_dx,center_dy);
99 if(!ret[index].offset.zero())index++;
107 return os <<
"(" << longEffect.
offset <<
"," << longEffect.
minIndex 108 <<
"," << longEffect.
maxIndex <<
")";
116 onStand[
PAWN] =StandPAWN;
117 onStand[
LANCE] =StandLANCE;
118 onStand[
KNIGHT]=StandKNIGHT;
119 onStand[
SILVER]=StandSILVER;
120 onStand[
GOLD] =StandGOLD;
121 onStand[
BISHOP]=StandBISHOP;
122 onStand[
ROOK] =StandROOK;
126 onStand[ptype]=onStand[
unpromote(ptype)];
134 for(
int i=0;i<2;i++,pl=
alt(pl)){
137 for(
int dy= -8;dy<=8;dy++)
138 for(
int dx= -8;dx<=8;dx++){
141 countShort(ptypeO,dx,dy);
149 for(
int i=0;i<2;i++,pl=
alt(pl)){
150 for(
int j=0;j<8;j++){
152 for(
int dy= -8;dy<=8;dy++)
153 for(
int dx= -8;dx<=8;dx++){
155 blockEffect[j][o32.
index()]=
164 for(
int i=0;i<2;i++,pl=
alt(pl)){
167 for(
int dy= -8;dy<=8;dy++)
168 for(
int dx= -8;dx<=8;dx++){
171 calcLong4(ptypeO,dx,dy);
181 for(
int x=1;x<=9;x++)
182 for(
int y=1;y<=9;y++){
185 for(
int dx=0;dx<5;dx++){
186 for(
int dy=0;dy<3;dy++){
187 const Square p(center.
x()+dx-2,center.
y()+dy-1);
188 int val=16-std::abs(p.x()-king.
x());
189 attackEffect[
BLACK][king.
index()][dx*3+dy]=val;
193 for(
int x=1;x<=9;x++)
194 for(
int y=1;y<=9;y++){
197 for(
int dx=0;dx<5;dx++){
198 for(
int dy=0;dy<3;dy++){
199 int r_dx=4-dx,r_dy=2-dy;
201 attackEffect[
BLACK][r_king.
index()][r_dx*3+r_dy];
210 for(
int x=1;x<=9;x++)
211 for(
int y=1;y<=9;y++){
214 for(
int dx=0;dx<5;dx++){
215 for(
int dy=0;dy<3;dy++){
216 const Square p(center.
x()+dx-2,center.
y()+dy-1);
217 int val=16-std::abs(p.x()-king.
x());
218 defenseEffect[
WHITE][king.
index()][dx*3+dy]=val;
222 for(
int x=1;x<=9;x++)
223 for(
int y=1;y<=9;y++){
226 for(
int dx=0;dx<5;dx++){
227 for(
int dy=0;dy<3;dy++){
228 int r_dx=4-dx,r_dy=2-dy;
230 defenseEffect[
WHITE][r_king.
index()][r_dx*3+r_dy];
243 setupDefenseEffect();
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す ...
int max(Player p, int v1, int v2)
static const EffectContent DIRECT()
void setupDefenseEffect()
constexpr int dirToMask(Direction dir)
constexpr Player alt(Player player)
int getMoveMask(Ptype ptype) const
static const Square adjustCenter(Square src)
int min(Player p, int v1, int v2)
Ptype getPtype(PtypeO ptypeO)
int y() const
将棋としてのY座標を返す.
int x() const
将棋としてのX座標を返す.
Offset32Base< 8, 9 > Offset32
PtypeO newPtypeO(Player player, Ptype ptype)
const PtypeTable Ptype_Table
Player getOwner(PtypeO ptypeO)
std::ostream & operator<<(std::ostream &os, LongEffect const &longEffect)
const Square rotate180() const
const EffectContent getEffect(PtypeO ptypeo, Square from, Square to) const
fromにいるptypeoがtoに利きを持つか?
constexpr Direction shortToLong(Direction d)
引数に longDirを与えてはいけない
unsigned int index() const
unsigned int index() const
constexpr int sign(Player player)
static osl::SetUpRegister _initializer([](){ osl::progress::Effect5x3_Table.init();})
PtypeO
Player + Ptype [-15, 15] PtypeO の O は Owner の O.
int getDxForBlack(Direction dir) const
int getDyForBlack(Direction dir) const
Effect5x3Table Effect5x3_Table
unsigned int ptypeOIndex(PtypeO ptypeo)
Direction getLongDirection(Offset32 offset32) const
5x3領域への長い利きの始まりと終わり. offset - 利きの方向が0の時は利きが無いことを示す minIndex - 利...
const BoardTable Board_Table