Online-TicTacToe

Log | Files | Refs | README | LICENSE

commit 8ef436c1278cf769e5ed88dac674d6670b6fbf64
parent 263641c7d215e5ee6e1a7cef615d3b580e8ce44c
Author: adglas21 <adamglasheen99@gmail.com>
Date:   Mon,  2 Dec 2024 12:15:39 +0000

Removed second forfeit button

Diffstat:
MTicTacToeClient/src/main/java/com/groupproject/tictactoeclient/ContentPanes/MainContentPanel.java | 19-------------------
MTicTacToeClient/src/main/java/com/groupproject/tictactoeclient/ContentPanes/register.java | 8--------
MTicTacToeClient/src/main/java/com/groupproject/tictactoeclient/HelperMethods.java | 8+++-----
MTicTacToeClient/src/main/java/com/groupproject/tictactoeclient/TicTacToeClient.java | 1-
4 files changed, 3 insertions(+), 33 deletions(-)

diff --git a/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/ContentPanes/MainContentPanel.java b/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/ContentPanes/MainContentPanel.java @@ -163,25 +163,6 @@ public class MainContentPanel extends CustomPanel { }); - - //forfeit button action listener - forfeitButton.addActionListener(e -> { - if(client.UID.equals(client.HOST_UID)) - { - client.proxy.setGameState(Integer.parseInt(client.GID), 2); - - - } - else - { - client.proxy.setGameState(Integer.parseInt(client.GID), 1); - } - - - refresh(); // refresh the list to show if there is a new game added - }); - - //forfeit button action listener diff --git a/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/ContentPanes/register.java b/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/ContentPanes/register.java @@ -196,14 +196,6 @@ public class register extends CustomPanel { - - - - - - - - } @Override diff --git a/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/HelperMethods.java b/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/HelperMethods.java @@ -73,7 +73,7 @@ public class HelperMethods { String[] options = {"Main Menu", "Quit"}; - // Display an option dialog with custom options + // Display an option dialog with custom options // The user's choice is stored in the 'choice' // variable int choice = JOptionPane.showOptionDialog( @@ -91,15 +91,13 @@ public class HelperMethods { // corresponding message if (choice == JOptionPane.YES_OPTION) { // If the user chose 'Yes' - // show a message indicating that they are - // proceeding + // reset their game and put them back to the main menu client.resetGame(); client.showPanel(new MainContentPanel(client)); } else if (choice == JOptionPane.NO_OPTION) { // If the user chose 'No' - // show a message indicating that they are not - // proceeding + // quit the application System.exit(0); } diff --git a/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/TicTacToeClient.java b/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/TicTacToeClient.java @@ -85,7 +85,6 @@ public class TicTacToeClient { } //reset the game data when user goes back to the main menu - //might be more to do but at the moment it works fine public void resetGame() { this.BOARD = null; this.GID = "";