procesarComerAlPaso function

void procesarComerAlPaso(
  1. int auxY,
  2. int auxX,
  3. int y,
  4. int x
)

Function that simulates the eat on the fly move.

Implementation

void procesarComerAlPaso(int auxY, int auxX, int y, int x) {
  BoardData board = BoardData();
  if ((x - auxX).abs() > 0 &&
      board.currentBoard[auxY][auxX] is Pawn &&
      board.currentBoard[y][x].isEmpty()) {
    board.currentBoard[auxY][x] = Empty(isWhite: false);
    (board.squares[auxY * 8 + x] as SquareState).actualizarEstado();
  }
}