|
|
|
@ -46,8 +46,6 @@ std::vector<Position> get_all_moves(Position pn, std::array<PieceType, 64> board
|
|
|
|
|
std::vector<Position> pns;
|
|
|
|
|
int x = pos_to_pair(pn).first;
|
|
|
|
|
int y = pos_to_pair(pn).second;
|
|
|
|
|
int dx;
|
|
|
|
|
int dy;
|
|
|
|
|
switch(pt){
|
|
|
|
|
case PieceType::B_ROOK:
|
|
|
|
|
case PieceType::W_ROOK:
|
|
|
|
@ -75,35 +73,7 @@ std::vector<Position> get_all_moves(Position pn, std::array<PieceType, 64> board
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
if (((i>x) && (i<8)) && ((j>y) && (j<8)))
|
|
|
|
|
{
|
|
|
|
|
dx = i-x;
|
|
|
|
|
dy = j-y;
|
|
|
|
|
if (dx == dy){pns.push_back(pair_to_pos(std::make_pair(x+dx,y+dy)));}
|
|
|
|
|
}
|
|
|
|
|
if (((i>=0) && (i<x)) && ((j>y) && (j<8)))
|
|
|
|
|
{
|
|
|
|
|
dx = i+1;
|
|
|
|
|
dy = j-y;
|
|
|
|
|
if (dx == dy){pns.push_back(pair_to_pos(std::make_pair(x-dx,y+dy)));}
|
|
|
|
|
}
|
|
|
|
|
if (((i>=0) && (i<x)) && ((j>=0) && (j<y)))
|
|
|
|
|
{
|
|
|
|
|
dx = i+1;
|
|
|
|
|
dy = j+1;
|
|
|
|
|
if (dx == dy){pns.push_back(pair_to_pos(std::make_pair(x-dx,y-dy)));}
|
|
|
|
|
}
|
|
|
|
|
if (((i>x) && (i<8)) && ((j>=0) && (j<y)))
|
|
|
|
|
{
|
|
|
|
|
dx = i-x;
|
|
|
|
|
dy = j+1;
|
|
|
|
|
if (dx == dy){pns.push_back(pair_to_pos(std::make_pair(x+dx,y-dy)));}
|
|
|
|
|
}
|
|
|
|
|
if ((i==x) && (j==y))
|
|
|
|
|
{
|
|
|
|
|
pns.push_back(pair_to_pos(std::make_pair(x,y)));
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|