I’m making a checkers game to my PI project, and I need help in the carregar funcion (Java), that doesn’t load in a new board
The problem is in the first, as said in title, it doesn’t load the saved game, it loads the game currently in the board to a new board.
hi, Im making a Checkers game to my PI project, and i need help in the carregar funcion (java), that doesnt load in a new board as i need, help pls
problem is in the first,as said in title, it doesnt load the saved game, it loads the game currently in the board to a new board.
`void carregar(){
String z = board.promptText(“Qual é o nome do ficheiro a carregar?”);
if (z == null || z.isEmpty()) {
return;
}
PositionTrace novoModel = new PositionTrace(model.blackCount, model.whiteCount, model.linha, model.coluna);
Board novoTabuleiro = new Board(quemJoga(), novoModel.linha, novoModel.coluna, 60);
novoTabuleiro.setBackgroundProvider(this::background);
novoTabuleiro.setIconProvider(this::icon);
novoTabuleiro.addMouseListener(this::click);
novoTabuleiro.addAction(“Novo Jogo”, this::action);
novoTabuleiro.addAction(“Aleatório”, this::aleatorio);
novoTabuleiro.addAction(“Gravar”, this::gravar);
novoTabuleiro.addAction(“Carregar”, this::carregar);
novoModel.load(z);
novoTabuleiro.setTitle(quemJoga());
novoTabuleiro.open();
}
void load(String fileName) {