diff --git a/src/backend/Board.java b/src/backend/Board.java index e6d1837..098347c 100644 --- a/src/backend/Board.java +++ b/src/backend/Board.java @@ -6,7 +6,7 @@ public class Board { private int cNum; private int lNum; - + private Piece newPiece; private Piece[][]Board; public Board(int colNum, int lineNum) { @@ -38,9 +38,9 @@ public class Board { return false; } } - - public void setPiece(boolean isWhite, PieceType type, int x, int y) { - //TODO + + public void setPiece(PieceType type, boolean isWhite, int x, int y) { + this.newPiece= new Piece(x,y,type,isWhite); } public void populateBoard() { diff --git a/src/backend/Game.java b/src/backend/Game.java index 4c64f70..6e27d1c 100644 --- a/src/backend/Game.java +++ b/src/backend/Game.java @@ -6,6 +6,7 @@ public class Game extends Thread { private AutoPlayer aiPlayer; private Board board; + private Piece newPiece; private MyInterface mjf; private int COL_NUM = 8; @@ -67,7 +68,7 @@ public class Game extends Thread { } public void setPiece(boolean isWhite, PieceType type, int x, int y) { - board.setPiece(isWhite, type, x, y); + this.newPiece = new Piece(x, y,type, isWhite); } public String[] getFileRepresentation() {