rendered paste bodypackage chess.christopherWachowicz;import chess.spec.*;public class Pawn extends Piece { public Pawn(String descriptor, Player color) { super(descriptor, color); // TODO Auto-generated constructor stub } public boolean canMove(Topology topology, Square[] squares, Square from, Square to){ boolean outcome = false; Square[] adjacent; adjacent = topology.getAdjacentSquares(squares, from); if(from.occupyingPiece.color() == Piece.Player.BLACK){ if(adjacent[DOWN] == to && to.isOccupied == false){ outcome = true; } else if(adjacent[DOWN_RIGHT] == to && to.isOccupied == true && to.occupyingPiece.color() == Piece.Player.WHITE){ outcome = true; } else if(adjacent[DOWN_LEFT] == to && to.isOccupied == true && to.occupyingPiece.color() == Piece.Player.WHITE){ outcome = true; } } else { if(adjacent[UP] == to && to.isOccupied == false){ outcome = true; } else if(adjacent[UP_LEFT] == to && to.isOccupied == true && to.occupyingPiece.color() == Piece.Player.BLACK){ outcome = true; } else if(adjacent[UP_RIGHT] == to && to.isOccupied == true && to.occupyingPiece.color() == Piece.Player.BLACK){ outcome = true; } } return outcome; } }