Implemented GUI side of resetting the board
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user