Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package chess;
- import java.lang.Math;
- public class King extends Piece{
- public King(PieceColour inColour) {
- colour = inColour;
- if (inColour==PieceColour.BLACK)
- super.setSymbol("\u265A");
- else
- super.setSymbol("\u2654");
- }
- @Override
- public boolean isLegitMove(int inRow1, int inColumn1, int inRow2, int inColumn2) {
- boolean legit = false;
- if ((Math.abs(inRow2-inRow1) <= 1) && (Math.abs(inColumn2-inColumn1) <=1)) {
- legit = true;
- }
- return legit;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement