From f3b7983ba0812fc14e6425d71dc2464416f485c1 Mon Sep 17 00:00:00 2001 From: Alexandre ALTARIBA Date: Fri, 18 Apr 2025 15:47:34 +0200 Subject: [PATCH] end of piece constructor --- src/backend/Piece.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/backend/Piece.java b/src/backend/Piece.java index 2f0ca19..e442fd8 100644 --- a/src/backend/Piece.java +++ b/src/backend/Piece.java @@ -4,10 +4,14 @@ public class Piece { private int x; private int y; + private char type; + private char color; - public Piece(int xP, int yP) { + public Piece(int xP, int yP, char type_P, char color_P) { x = xP; y = yP; + type = type_P; + color = color_P; } public int getX() { @@ -19,11 +23,16 @@ public class Piece { } public PieceType getType() { - return null; + return PieceType.fromSummary(type); } public boolean isWhite() { - return false; + if(color =='w') { + return true; + } + else { + return false; + } } }