Merge branch 'master' of https://gitarero.ecam.fr/noa.four/OOP_Group1B2_Project
This commit is contained in:
commit
615c17ad42
|
|
@ -209,10 +209,22 @@ public class Board {
|
|||
/* saving-loading feature :*/
|
||||
|
||||
public String[] toFileRep() {
|
||||
//TODO
|
||||
return null;
|
||||
ArrayList<String> lines = new ArrayList<>();
|
||||
|
||||
for (int y = 0; y < 8; y++) {
|
||||
for (int x = 0; x < 8; x++) {
|
||||
Piece piece = cells[x][y];
|
||||
if (piece != null) {
|
||||
String line = piece.isWhite() + " " + piece.getType() + " " + x + " " + y;
|
||||
lines.add(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return lines.toArray(new String[0]);
|
||||
}
|
||||
|
||||
|
||||
public Board(String[] array) {
|
||||
//TODO
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public class Move {
|
|||
this.fromY = fromY;
|
||||
this.toX = toX;
|
||||
this.toY = toY;
|
||||
this.capturedPiece = capturedPiece;
|
||||
//this.capturedPiece = capturedPiece;
|
||||
}
|
||||
public Piece getPiece() {
|
||||
return piece;
|
||||
|
|
@ -39,5 +39,5 @@ public class Move {
|
|||
return piece + ":("+ fromX + "," + fromY + ")-("+ toX + "," + toY + ")" +
|
||||
( capturedPiece != null? "capturing "+ capturedPiece: "");
|
||||
}
|
||||
// remove commit message
|
||||
/// mjs
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue