IT WORKS !! So now we can save and load boards :)
This commit is contained in:
parent
16c4594e37
commit
2417b7b2ba
|
|
@ -228,8 +228,8 @@ public class Board {
|
|||
String[] tokens = line.trim().split("\\s+");
|
||||
if (tokens.length != 4) continue;
|
||||
|
||||
boolean isWhite = Boolean.parseBoolean(tokens[0]);
|
||||
PieceType type = PieceType.valueOf(tokens[1]);
|
||||
PieceType type = PieceType.valueOf(tokens[0]);
|
||||
boolean isWhite = Boolean.parseBoolean(tokens[1]);
|
||||
int x = Integer.parseInt(tokens[2]);
|
||||
int y = Integer.parseInt(tokens[3]);
|
||||
|
||||
|
|
@ -237,12 +237,14 @@ public class Board {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Board(String[] array) {
|
||||
//TODO
|
||||
|
||||
this.cNum = 8;
|
||||
this.lNum = 8;
|
||||
this.cells = new Piece[cNum][lNum];
|
||||
this.selectedCell = null;
|
||||
loadFromFileRep(array);
|
||||
}
|
||||
|
||||
|
||||
/* The following methods require more work ! */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue