From d802462ea020e697b75a5172df749cef71fab28c Mon Sep 17 00:00:00 2001 From: "g.vancompernolle" Date: Wed, 9 Apr 2025 09:44:54 +0200 Subject: [PATCH] piece --- src/backend/Board.java | 1 + src/backend/Piece.java | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/backend/Board.java b/src/backend/Board.java index 2acacca..841c058 100644 --- a/src/backend/Board.java +++ b/src/backend/Board.java @@ -6,6 +6,7 @@ public class Board { private int width; private int height; + private ArrayList pieces = new ArrayList<>(); public Board(int colNum, int lineNum) { this.width = colNum; diff --git a/src/backend/Piece.java b/src/backend/Piece.java index c560daf..8e07acd 100644 --- a/src/backend/Piece.java +++ b/src/backend/Piece.java @@ -1,21 +1,32 @@ package backend; public class Piece { + private int x; + private int y; + private PieceType type; + private boolean isWhite; + + public Piece(PieceType type, boolean isWhite, int x, int y) { + this.type = type; + this.isWhite = isWhite; + this.x = x; + this.y = y; + } 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; } }