diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 5367d73..6eb056e 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,10 +7,17 @@
+
+
+
+
+
+
+
+
-
@@ -55,14 +62,14 @@
- {
- "keyToString": {
- "RunOnceActivity.OpenProjectViewOnStart": "true",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "last_opened_file_path": "/home/stanlee77/code/chessEngine/src/com/jarocki/stanislaw/chess/Piece",
- "settings.editor.selected.configurable": "reference.settings.project.maven.runner"
+
+}]]>
diff --git a/src/com/jarocki/stanislaw/chess/Board/Board.java b/src/com/jarocki/stanislaw/chess/Board/Board.java
index 185592b..8457bf0 100644
--- a/src/com/jarocki/stanislaw/chess/Board/Board.java
+++ b/src/com/jarocki/stanislaw/chess/Board/Board.java
@@ -5,8 +5,6 @@ import com.jarocki.stanislaw.chess.Coordinate.Row;
import com.jarocki.stanislaw.chess.Piece.*;
import com.jarocki.stanislaw.chess.Piece.Color;
-import java.awt.*;
-
public class Board {
private final Basic[][] fields;
private boolean hasWhiteKingMoved;
@@ -48,16 +46,6 @@ public class Board {
fields[Row.EIGHT.getNum()][Column.F.ordinal()] = new Bishop(Color.BLACK, Row.EIGHT, Column.F);
}
- public void movePiece(Column currentColumn, Row currentRow, Column targetColumn, Row targetRow) {
- int currRow = currentRow.ordinal();
- int currCol = currentColumn.ordinal();
- int targRow = targetRow.ordinal();
- int targCol = targetColumn.ordinal();
- Basic piece = fields[currRow][currCol];
- fields[currRow][currCol] = null;
- fields[targRow][targCol] = piece;
- }
-
public void printBoard() {
System.out.println();
@@ -116,17 +104,13 @@ public class Board {
// remove en passant captured pawn from board
if (piece.getSymbol().equals(Symbol.PAWN)) {
- Pawn pawn = new Pawn(piece.getColor(), piece.getRow(), piece.getColumn());
if (Math.abs(fromRow - toRow) == 1 && Math.abs(fromCol - toCol) == 1 && fields[toRow][toCol] == null) {
- int capturedPawnRow = fromRow;
- int capturedPawnCol = toCol;
- removePiece(capturedPawnRow, capturedPawnCol);
+ removePiece(fromRow, toCol);
}
}
// castling check
if (piece.getSymbol().equals(Symbol.KING)) {
- King king = new King(piece.getColor(), piece.getRow(), piece.getColumn());
if (Math.abs(fromCol - toCol) == 2) {
// short castling
if (toCol > fromCol) {
@@ -208,7 +192,7 @@ public class Board {
System.out.println("Move invalid for a particular piece. (Board)");
return false;
}
-// make sure the move doesnt lead to check
+// make sure the move doesn't lead to check
Board tempBoard = copy();
tempBoard.makeMove(fromRow, fromCol, toRow, toCol);
@@ -228,7 +212,7 @@ public class Board {
copy.removePiece(row, col);
}
}
- // copyt board state
+ // copy board state
for (int row = 0; row < 8; row++) {
for (int col = 0; col < 8; col++) {
Basic piece = fields[row][col];
@@ -295,29 +279,29 @@ public class Board {
}
}
- // check for each opponent piece if can take the king out
+ // check for each opponent piece if it can take the king out
for (int row = 0; row < 8; row++) {
for (int col = 0; col < 8; col++) {
Basic piece = fields[row][col];
if (piece != null && piece.getColor() != kingColor) {
Basic particularPiece = piece;
if(piece.getSymbol().equals(Symbol.QUEEN)){
- particularPiece = (Queen) new Queen(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
+ particularPiece = new Queen(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
}
if(piece.getSymbol().equals(Symbol.KING)){
- particularPiece = (King) new King(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
+ particularPiece = new King(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
}
if(piece.getSymbol().equals(Symbol.KNIGHT)){
- particularPiece = (Knight) new Knight(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
+ particularPiece = new Knight(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
}
if(piece.getSymbol().equals(Symbol.BISHOP)){
- particularPiece = (Bishop) new Bishop(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
+ particularPiece = new Bishop(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
}
if(piece.getSymbol().equals(Symbol.ROOK)){
- particularPiece = (Rook) new Rook(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
+ particularPiece = new Rook(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
}
if(piece.getSymbol().equals(Symbol.PAWN)){
- particularPiece = (Pawn) new Pawn(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
+ particularPiece = new Pawn(particularPiece.getColor(), particularPiece.getRow(), particularPiece.getColumn());
}
if (particularPiece.isMoveValid(kingRow, kingCol, this)) {
diff --git a/src/com/jarocki/stanislaw/chess/Coordinate/Column.java b/src/com/jarocki/stanislaw/chess/Coordinate/Column.java
index 3fb8d21..4f79778 100644
--- a/src/com/jarocki/stanislaw/chess/Coordinate/Column.java
+++ b/src/com/jarocki/stanislaw/chess/Coordinate/Column.java
@@ -15,25 +15,16 @@ public enum Column {
}
public static Column getColByNum(String number) {
- switch (number) {
- case "1":
- return Column.A;
- case "2":
- return Column.B;
- case "3":
- return Column.C;
- case "4":
- return Column.D;
- case "5":
- return Column.E;
- case "6":
- return Column.F;
- case "7":
- return Column.G;
- case "8":
- return Column.H;
- default:
- throw new IllegalArgumentException("Invalid column number: " + number);
- }
+ return switch (number) {
+ case "1" -> Column.A;
+ case "2" -> Column.B;
+ case "3" -> Column.C;
+ case "4" -> Column.D;
+ case "5" -> Column.E;
+ case "6" -> Column.F;
+ case "7" -> Column.G;
+ case "8" -> Column.H;
+ default -> throw new IllegalArgumentException("Invalid column number: " + number);
+ };
}
}
diff --git a/src/com/jarocki/stanislaw/chess/Coordinate/Coordinate.java b/src/com/jarocki/stanislaw/chess/Coordinate/Coordinate.java
deleted file mode 100644
index db532fc..0000000
--- a/src/com/jarocki/stanislaw/chess/Coordinate/Coordinate.java
+++ /dev/null
@@ -1,117 +0,0 @@
-//package com.jarocki.stanislaw.chess.Coordinate;
-//
-//import com.jarocki.stanislaw.chess.Player.Role;
-//
-//public class Coordinate {
-// private String lastMoveFrom;
-// private String lastMoveTo;
-// private Column lastMoveFromCol;
-// private Row lastMoveFromRow;
-// private Column lastMoveToCol;
-// private Row lastMoveToRow;
-//
-// public void setLastMove(String moveFrom, String moveTo) {
-// if(moveFrom == null || moveTo == null) {
-// System.out.println("Some moves are missing: moveFrom = " + moveFrom + " and moveTo = " + moveTo + " (setLastMove)");
-// }
-// setLastMoveFrom(moveFrom);
-// setLastMoveTo(moveTo);
-// }
-//
-// public void convertMoveToCoordinates() {
-// String moveFrom = this.getLastMoveFrom();
-// String moveTo = this.getLastMoveTo();
-//
-// if (moveFrom.length() != 2 || moveTo.length() != 2) {
-// throw new RuntimeException("Incorrect move coordinates (convertMoveToCoordinates)");
-// }
-//
-// Column moveFromCol = Column.valueOf(moveFrom.substring(0, 1));
-// Row moveFromRow = Row.getRowByNumber(moveFrom.substring(1,2));
-// Column moveToCol = Column.valueOf(moveTo.substring(0, 1));
-// Row moveToRow = Row.getRowByNumber(moveTo.substring(1,2));
-//
-// setLastMoveFromCol(moveFromCol);
-// setLastMoveFromRow(moveFromRow);
-// setLastMoveToCol(moveToCol);
-// setLastMoveToRow(moveToRow);
-// }
-//
-// public String convertMoveToString() {
-// Row rowFrom = this.getLastMoveFromRow();
-// Row rowTo = this.getLastMoveToRow();
-// Column colFrom = this.getLastMoveFromCol();
-// Column colTo = this.getLastMoveToCol();
-//
-// return (
-// colFrom.toString() +
-// String.valueOf(rowFrom.getNum()) +
-// colTo.toString() +
-// String.valueOf(rowTo.getNum())
-// );
-// }
-//
-// public void displayMoveInfo() {
-// String from = this.getLastMoveFrom();
-// String to = this.getLastMoveTo();
-// String playerName = this.getRole().formatName();
-//
-// if (from == null || to == null) {
-// System.out.println("Player " + playerName + " hasn't moved yet");
-// return;
-// }
-//
-// System.out.println("Player " + playerName + " moved from " + from + " to " + to);
-// }
-// public Column getLastMoveFromCol() {
-// return lastMoveFromCol;
-// }
-//
-// public void setLastMoveFromCol(Column lastMoveFromCol) {
-// this.lastMoveFromCol = lastMoveFromCol;
-// }
-//
-// public Row getLastMoveFromRow() {
-// return lastMoveFromRow;
-// }
-//
-// public void setLastMoveFromRow(Row lastMoveFromRow) {
-// this.lastMoveFromRow = lastMoveFromRow;
-// }
-//
-// public Column getLastMoveToCol() {
-// return lastMoveToCol;
-// }
-//
-// public void setLastMoveToCol(Column lastMoveToCol) {
-// this.lastMoveToCol = lastMoveToCol;
-// }
-//
-// public Row getLastMoveToRow() {
-// return lastMoveToRow;
-// }
-//
-// public void setLastMoveToRow(Row lastMoveToRow) {
-// this.lastMoveToRow = lastMoveToRow;
-// }
-//
-// public Role getRole() {
-// return role;
-// }
-//
-// public String getLastMoveFrom() {
-// return lastMoveFrom;
-// }
-//
-// private void setLastMoveFrom(String lastMoveFrom) {
-// this.lastMoveFrom = lastMoveFrom;
-// }
-//
-// public String getLastMoveTo() {
-// return lastMoveTo;
-// }
-//
-// private void setLastMoveTo(String lastMoveTo) {
-// this.lastMoveTo = lastMoveTo;
-// }
-//}
diff --git a/src/com/jarocki/stanislaw/chess/Coordinate/Row.java b/src/com/jarocki/stanislaw/chess/Coordinate/Row.java
index 42df46b..0d1e0b4 100644
--- a/src/com/jarocki/stanislaw/chess/Coordinate/Row.java
+++ b/src/com/jarocki/stanislaw/chess/Coordinate/Row.java
@@ -11,26 +11,17 @@ public enum Row {
EIGHT;
public static Row getRowByNum(String number) {
- switch (number) {
- case "1":
- return Row.ONE;
- case "2":
- return Row.TWO;
- case "3":
- return Row.THREE;
- case "4":
- return Row.FOUR;
- case "5":
- return Row.FIVE;
- case "6":
- return Row.SIX;
- case "7":
- return Row.SEVEN;
- case "8":
- return Row.EIGHT;
- default:
- throw new IllegalArgumentException("Invalid row number: " + number);
- }
+ return switch (number) {
+ case "1" -> Row.ONE;
+ case "2" -> Row.TWO;
+ case "3" -> Row.THREE;
+ case "4" -> Row.FOUR;
+ case "5" -> Row.FIVE;
+ case "6" -> Row.SIX;
+ case "7" -> Row.SEVEN;
+ case "8" -> Row.EIGHT;
+ default -> throw new IllegalArgumentException("Invalid row number: " + number);
+ };
}
public int getNum() {
diff --git a/src/com/jarocki/stanislaw/chess/Game.java b/src/com/jarocki/stanislaw/chess/Game.java
index 5780d19..7b55fa5 100644
--- a/src/com/jarocki/stanislaw/chess/Game.java
+++ b/src/com/jarocki/stanislaw/chess/Game.java
@@ -8,16 +8,9 @@ import com.jarocki.stanislaw.chess.Player.Role;
import java.util.Scanner;
public class Game {
- private Board board;
-
private boolean isGameOn;
-
private boolean isWhiteTurn = true;
- public Game() {
- board = new Board();
- }
-
public void play() {
Scanner scanner = new Scanner(System.in);
this.setIsGameOn(true);
@@ -28,7 +21,7 @@ public class Game {
int iteration = 0; // tests only
-// String[] testMoves = Test.getOnlyPawnsOpening();
+ String[] testMoves = Test.getOnlyPawnsOpening();
// String[] testMoves = Test.getWrongPawnMoves();
// String[] testMoves = Test.takeQueenOut();
// String[] testMoves = Test.takeBishopOut();
@@ -36,16 +29,15 @@ public class Game {
// String[] testMoves = Test.takeRookOut();
// String[] testMoves = Test.takeKingOut();
// String[] testMoves = Test.getCastlingMoves();
- String[] testMoves = Test.getPawnPromotion();
+// String[] testMoves = Test.getPawnPromotion();
// String[] testMoves = Test.getOpeningMoves();
-
while(getIsGameOn()) {
board.printBoard();
Color playerColor = this.getIsWhiteTurn() ? Color.WHITE : Color.BLACK;
- System.out.println("Enter " + playerColor.toString() + " next move: ");
+ System.out.println("Enter " + playerColor + " next move: ");
Test.delay(300);
@@ -73,7 +65,7 @@ public class Game {
int toRow = currPlayer.getLastMoveToRow().getNum();
int toCol = currPlayer.getLastMoveToCol().getNum();
- Test.displayCurrentMove(currPlayer.getRole().formatName(), moves[0], moves[1]);
+// Test.displayCurrentMove(currPlayer.getRole().formatName(), moves[0], moves[1]);
if (!board.isMoveValid(fromRow, fromCol, toRow, toCol, playerColor)) {
System.out.println("Moving " + currPlayer.getRole().formatName() + " from " + moves[0] + " to " + moves[1] + " is illegal. (Game)");
@@ -87,6 +79,8 @@ public class Game {
this.switchTurn();
currPlayer.switchRole();
}
+ // implement check win
+ System.out.println("Congratulations, check-mate!");
scanner.close();
}
diff --git a/src/com/jarocki/stanislaw/chess/Piece/Bishop.java b/src/com/jarocki/stanislaw/chess/Piece/Bishop.java
index 0226149..5867adf 100644
--- a/src/com/jarocki/stanislaw/chess/Piece/Bishop.java
+++ b/src/com/jarocki/stanislaw/chess/Piece/Bishop.java
@@ -7,7 +7,7 @@ import com.jarocki.stanislaw.chess.Coordinate.Row;
public class Bishop extends Basic {
public Bishop(Color color, Row row, Column col) {
super(color, row, col);
- setSymbol(getSymbol().BISHOP);
+ setSymbol(Symbol.BISHOP);
}
@Override
@@ -47,8 +47,4 @@ public class Bishop extends Basic {
Basic destinationPiece = board.getPiece(toRow, toCol);
return destinationPiece == null || destinationPiece.getColor() != this.getColor();
}
-
- public Basic copy() {
- return new Bishop(this.getColor(), this.getRow(), this.getColumn());
- }
}
diff --git a/src/com/jarocki/stanislaw/chess/Piece/Color.java b/src/com/jarocki/stanislaw/chess/Piece/Color.java
index 6b28060..78e0b3f 100644
--- a/src/com/jarocki/stanislaw/chess/Piece/Color.java
+++ b/src/com/jarocki/stanislaw/chess/Piece/Color.java
@@ -5,6 +5,6 @@ public enum Color {
BLACK;
public String toString() {
- return this.name().substring(0,1) + this.name().substring(1).toLowerCase();
+ return this.name().charAt(0) + this.name().substring(1).toLowerCase();
}
}
diff --git a/src/com/jarocki/stanislaw/chess/Piece/King.java b/src/com/jarocki/stanislaw/chess/Piece/King.java
index e3a43af..31be7fe 100644
--- a/src/com/jarocki/stanislaw/chess/Piece/King.java
+++ b/src/com/jarocki/stanislaw/chess/Piece/King.java
@@ -5,7 +5,7 @@ import com.jarocki.stanislaw.chess.Coordinate.Column;
import com.jarocki.stanislaw.chess.Coordinate.Row;
public class King extends Basic {
- private boolean hasMoved;
+ private final boolean hasMoved;
public King(Color color, Row row, Column col) {
super(color, row, col);
@@ -29,13 +29,10 @@ public class King extends Basic {
int dRow = Math.abs(toRow - row);
int dCol = Math.abs(toCol - col);
- // king can move only by one tile unless its a castling
+ // king can move only by one tile unless it's a castling
if ((dRow != 1 || dCol != 0) && (dRow != 0 || dCol != 1) && (dRow != 1 || dCol != 1)) {
- // Check for castling
- if (isCastlingMove(toRow, toCol, board)) {
- return true;
- }
- return false;
+ // castling check
+ return isCastlingMove(toRow, toCol, board);
}
// check if destination is empty or with opponent
@@ -43,15 +40,8 @@ public class King extends Basic {
return destinationPiece == null || destinationPiece.getColor() != this.getColor();
}
- public Basic copy() {
- King copy = new King(this.getColor(), this.getRow(), this.getColumn());
- copy.hasMoved = hasMoved;
- return copy;
- }
-
private boolean isCastlingMove(int toRow, int toCol, Board board) {
int fromRow = this.getRow().getNum();
- int fromCol = this.getColumn().getNum();
// check if king moved
if (hasMoved()) {
@@ -68,19 +58,17 @@ public class King extends Basic {
return false;
}
- //
int rookCol = (toCol == 2) ? 0 : 7;
Rook rook = (Rook) board.getPiece(fromRow, rookCol);
- if (!(rook instanceof Rook) || rook.getColor() != this.getColor()) {
+ if (!(rook.getSymbol().equals(Symbol.ROOK)) || rook.getColor() != this.getColor()) {
return false;
}
- // Check if the path between the king and rook is clear
+ // check path between rook and king
int startCol = (toCol == 2) ? 1 : 5;
int endCol = (toCol == 2) ? 3 : 6;
- int row = fromRow;
for (int col = startCol; col <= endCol; col++) {
- Basic piece = board.getPiece(row, col);
+ Basic piece = board.getPiece(fromRow, col);
if (piece != null) {
return false;
}
diff --git a/src/com/jarocki/stanislaw/chess/Piece/Knight.java b/src/com/jarocki/stanislaw/chess/Piece/Knight.java
index 9da5799..ae89b0d 100644
--- a/src/com/jarocki/stanislaw/chess/Piece/Knight.java
+++ b/src/com/jarocki/stanislaw/chess/Piece/Knight.java
@@ -24,8 +24,4 @@ public class Knight extends Basic {
// knight can move only in "L" path = to cols up one row vert and vice versa
return (dRow == 2 && dCol == 1) || (dRow == 1 && dCol == 2);
}
-
- public Basic copy() {
- return new Knight(this.getColor(), this.getRow(), this.getColumn());
- }
}
diff --git a/src/com/jarocki/stanislaw/chess/Piece/Pawn.java b/src/com/jarocki/stanislaw/chess/Piece/Pawn.java
index 579ecc6..5edba3e 100644
--- a/src/com/jarocki/stanislaw/chess/Piece/Pawn.java
+++ b/src/com/jarocki/stanislaw/chess/Piece/Pawn.java
@@ -26,7 +26,7 @@ public class Pawn extends Basic {
if (targetRow - getRow().getNum() == 1) {
return true;
} else if (isStartingPosition(getRow(), getColor()) && targetRow - getRow().getNum() == 2) {
- // check if can move two tiles
+ // check if it can move two tiles
if (board.getPiece(getRow().getNum() + 1, targetColumn) == null) {
return true;
}
@@ -35,19 +35,16 @@ public class Pawn extends Basic {
if (targetRow - getRow().getNum() == -1) {
return true;
} else if (isStartingPosition(getRow(), getColor()) && targetRow - getRow().getNum() == -2) {
- // check if can move two tiles
+ // check if thing can move two tiles
if (board.getPiece(getRow().getNum() - 1, targetColumn) == null) {
return true;
}
}
}
}
- // if en passant
- return isValidCapture(targetRow, targetColumn, board);
- } else {
- // i know it's silly but works
- return isValidCapture(targetRow, targetColumn, board);
}
+ // if en passant
+ return isValidCapture(targetRow, targetColumn, board);
}
private boolean isValidCapture(int targetRow, int targetColumn, Board board) {
@@ -63,31 +60,23 @@ public class Pawn extends Basic {
// check target tile
if (targetRow == getRow().getNum() + (getColor() == Color.WHITE ? 1 : -1)) {
Pawn lastMovedPawn = board.getLastMovedPawn();
- if (lastMovedPawn != null && lastMovedPawn.getRow() == getRow() &&
- lastMovedPawn.getColumn().getNum() == targetColumn) {
- // correct en passant
- return true;
- }
+ // correct en passant
+ return lastMovedPawn != null && lastMovedPawn.getRow() == getRow() &&
+ lastMovedPawn.getColumn().getNum() == targetColumn;
}
}
return false;
}
- int col = getColumn().getNum();
if (targetColumn == getColumn().getNum() - 1) {
// diagonal to top left
- Color color = getColor();
if (getColor() == Color.WHITE && targetRow == getRow().getNum() + 1) {
return true;
- } else if (getColor() == Color.BLACK && targetRow == getRow().getNum() - 1) {
- return true;
- }
+ } else return getColor() == Color.BLACK && targetRow == getRow().getNum() - 1;
} else if (targetColumn == getColumn().getNum() + 1) {
// one tile to top right
if (getColor() == Color.WHITE && targetRow == getRow().getNum() + 1) {
return true;
- } else if (getColor() == Color.BLACK && targetRow == getRow().getNum() - 1) {
- return true;
- }
+ } else return getColor() == Color.BLACK && targetRow == getRow().getNum() - 1;
}
return false;
diff --git a/src/com/jarocki/stanislaw/chess/Piece/Queen.java b/src/com/jarocki/stanislaw/chess/Piece/Queen.java
index e1283fa..e580787 100644
--- a/src/com/jarocki/stanislaw/chess/Piece/Queen.java
+++ b/src/com/jarocki/stanislaw/chess/Piece/Queen.java
@@ -27,8 +27,8 @@ public class Queen extends Basic {
}
// check if there's sth between her and the destination
- int stepRow = dRow == 0 ? 0 : (dRow > 0 ? 1 : -1);
- int stepCol = dCol == 0 ? 0 : (dCol > 0 ? 1 : -1);
+ int stepRow = Integer.compare(dRow, 0);
+ int stepCol = Integer.compare(dCol, 0);
int currentRow = row + stepRow;
int currentCol = col + stepCol;
@@ -46,8 +46,4 @@ public class Queen extends Basic {
Basic destinationPiece = board.getPiece(toRow, toCol);
return destinationPiece == null || destinationPiece.getColor() != this.getColor();
}
-
- public Basic copy() {
- return new Queen(this.getColor(), this.getRow(), this.getColumn());
- }
}
diff --git a/src/com/jarocki/stanislaw/chess/Piece/Rook.java b/src/com/jarocki/stanislaw/chess/Piece/Rook.java
index ce706da..28ead37 100644
--- a/src/com/jarocki/stanislaw/chess/Piece/Rook.java
+++ b/src/com/jarocki/stanislaw/chess/Piece/Rook.java
@@ -5,7 +5,6 @@ import com.jarocki.stanislaw.chess.Coordinate.Column;
import com.jarocki.stanislaw.chess.Coordinate.Row;
public class Rook extends Basic {
- private boolean hasMoved = false;
public Rook(Color color, Row row, Column col) {
super(color, row, col);
setSymbol(Symbol.ROOK);
@@ -49,12 +48,4 @@ public class Rook extends Basic {
Basic destinationPiece = board.getPiece(toRow, toCol);
return destinationPiece == null || destinationPiece.getColor() != this.getColor();
}
-
- public void setHasMoved() {
- hasMoved = true;
- }
-
- public Basic copy() {
- return new Rook(this.getColor(), this.getRow(), this.getColumn());
- }
}