//Execute anything that must occur after a move for any piece //Meant to be overidden only if there is some specific action //Ex. A pawn becoming a Queen at the end of a move if it is at the end of the board public virtual void afterMoveAction(GameBoard board) { //Left blank intentionally as the default is no afterMoveAction }
public abstract MoveList getPieceMoves(GameBoard board, Location startLocation, ColorEnum color);
/* * Gets a list of moves that the piece can make based on its typing from inheriting AbstractPiece with getPieceMoves */ public MoveList getMoves(GameBoard board) { return(getMoves(board, this.location, this.color)); }
public MoveList getMoves(GameBoard board, Location startLocation, ColorEnum color) { return(getPieceMoves(board, startLocation, color)); }
/* * Takes a move as a parameter and checks if the possible moves generated by getMoves includes it */ public bool checkMove(GameBoard board, Move move) { return(checkMove(board, this.location, move)); }