From dc00037eaa5cb5487aad809196b8ec8f91f22c96 Mon Sep 17 00:00:00 2001 From: carol Date: Thu, 17 Apr 2025 10:59:53 +0200 Subject: [PATCH] added isWhite, pieceType and getter of X and Y in piece --- src/backend/Piece.java | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/backend/Piece.java b/src/backend/Piece.java index ffa88bb..66f58ce 100644 --- a/src/backend/Piece.java +++ b/src/backend/Piece.java @@ -1,21 +1,35 @@ package backend; public class Piece { + + private int x; + private int y; + private boolean isWhite; + private PieceType type; + public Piece(int x, int y, boolean isWhite, PieceType type) { + this.x = x; + this.y = y; + this.isWhite = isWhite; + this.type = type; + } + public int getX() { - return 0; + return x; } public int getY() { - return 0; + return y; } public PieceType getType() { - return null; + + return type; } public boolean isWhite() { - return false; + + return isWhite; } }