Compare commits

...

2 Commits

Author SHA1 Message Date
keshi 5cc24e4348 Merge branch 'master' of
https://gitarero.ecam.fr/keshini.nistar/OOP_Groupe_1A3_Project.git
2025-05-06 15:58:46 +02:00
keshi 318be7fb35 we added array list, clean board, get pieces, set piece
we started tostring and usertouch
2025-05-06 15:48:48 +02:00
1 changed files with 11 additions and 10 deletions

View File

@ -14,12 +14,12 @@ public class Main {
// testing :
//testing the board
Board testBoard = new Board(8, 8);
//getting the pieces on the board
testBoard.populateBoard();
System.out.println(testBoard.getWidth());
System.out.println(testBoard.getHeight());
System.out.println(testBoard.toString());
//testing the pieces coordinates, colour and type
Piece testPiece= new Piece(1,2, PieceType.Rook, false);
System.out.println(testPiece.getX());
@ -28,21 +28,22 @@ public class Main {
System.out.println(testPiece.isWhite());
//getting the pieces on the board
System.out.println(testBoard.getPieces());
testBoard.setPiece(false, PieceType.Knight, 4, 4);
testBoard.setPiece(false, PieceType.Queen, 3, 3);
//clean the board
ArrayList<Piece> allPieces=testBoard.getPieces();
for (Piece piece:allPieces) {
System.out.println((piece.isWhite() ? "White ":"Black ")+ piece.getType().getSummary()+" located at "+ piece.getX()+ "," + piece.getY());
}
//adding new piece to the board
testBoard.setPiece(true, PieceType.Bishop, 4, 7);
testBoard.toString();
// launches graphical interface :
MyInterface mjf = new MyInterface();
mjf.setVisible(true);
//cleaning the board
testBoard.cleanBoard();
}
}