Implemented GUI side of resetting the board

This commit is contained in:
2021-03-19 11:15:22 +01:00
parent b72e03711a
commit fa7bda4230
4 changed files with 14 additions and 11 deletions

View File

@@ -82,6 +82,11 @@ public class TicTacToe_Client {
}
//this.drawWinningLine(winCoordinates);
//client.exitProcess();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
client.resetBoard();
}
} else {

View File

@@ -152,6 +152,10 @@ public class Client {
}
}
public void printLog(String message, boolean success){
clientLogger.printLog(message, success, LogType.Log);
}
public String getName() {
return name;
}

View File

@@ -23,7 +23,6 @@ public class Engine extends Application {
private boolean mouseClicked = false;
private Point coordinates = new Point();
private Stage primaryStage;
private MouseEvent mouseEvent;
public Engine() {
setEngine(this);
@@ -91,6 +90,9 @@ public class Engine extends Application {
System.err.println("Wrong length of gameState string");
return;
}
if (gameState.equals("---------")){
grid.getChildren().clear();
}
for (int i = 0; i < gameState.length(); i++) {
int column = i / 3;
int row = i % 3;