Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package chess;
- public class Pawn extends Piece{
- public Pawn(PieceColour colour){
- this.colour = colour;
- if (colour == PieceColour.WHITE){
- setSymbol("wp");
- }
- else {
- setSymbol("bp");
- }
- }
- public boolean isLegitMove(int iIn, int jIn, int iOut, int jOut){
- // Board b = new Board();
- if (iOut == iIn+1 && jOut == jIn){
- return true;
- }
- // else if (iOut == iIn+1 && jOut == jIn+1 && b.hasPiece() == true){
- // return true;
- // }
- // else if (iOut == iIn+1 && jOut == jIn-1 && b.hasPiece() == true){
- // return true;
- // }
- else {
- return false;
- }
- // return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement