From 4f985c9abd699c86345f6cba99f8eefd38af3d95 Mon Sep 17 00:00:00 2001 From: MSI Date: Fri, 18 Apr 2025 17:06:21 +0200 Subject: [PATCH] recover the piece --- src/backend/Move.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/backend/Move.java b/src/backend/Move.java index 79419d8..3203b1d 100644 --- a/src/backend/Move.java +++ b/src/backend/Move.java @@ -4,6 +4,7 @@ public class Move { private Piece piece; private int fromX, fromY; private int toX, toY; + private Piece capturedPiece; public Move ( Piece piece, int fromX, int fromY, int toX, int toY, Piece captured) { this.piece = piece; @@ -11,6 +12,7 @@ public class Move { this.fromY = fromY; this.toX = toX; this.toY = toY; + this.capturedPiece = capturedPiece; } public Piece getPiece() { return piece; @@ -27,5 +29,10 @@ public class Move { public int getToY() { return toY; } - // deleted the capturedPiece + public Piece getCapturedPiece() { + return capturedPiece; + } + public boolean isCapture() { + return capturedPiece; + } }