View/GamePVPView.java
public void createEndAlert(Alert alert){
        ButtonType alertButton1 = new ButtonType("Go Back");
        ButtonType alertButton2 = new ButtonType("Exit");
        alert.getButtonTypes().setAll(alertButton1,alertButton2);
        Optional<ButtonType> result = alert.showAndWait();

        if (result.get() == alertButton1){
            StartView sv = new StartView();
            stage.close();
        }
        if (result.get() == alertButton2){
            stage.close();
        }
    }
/*Creates an alert signaling that the game has ended. Shows the winner.
     *Gives option to continue playing or exit the game
     */
Creates an alert signaling that the game has ended. Shows the winner.
Gives option to continue playing or exit the game
Creates an alert signaling that the game has ended . Shows the winner . Gives option to continue playing or exit the game
public void createEndAlert(Alert alert){
        ButtonType alertButton1 = new ButtonType("Go Back");
        ButtonType alertButton2 = new ButtonType("Exit");
        alert.getButtonTypes().setAll(alertButton1,alertButton2);
        Optional<ButtonType> result = alert.showAndWait();
        if (result.get() == alertButton1){
            StartView sv = new StartView();
            stage.close();
        }
        if (result.get() == alertButton2){
            stage.close();
        }
    }
public void createEndAlert ( Alert alert ) { ButtonType alertButton1 = new ButtonType ( "Go Back" ) ; ButtonType alertButton2 = new ButtonType ( "Exit" ) ; alert . getButtonTypes ( ) . setAll ( alertButton1 , alertButton2 ) ; Optional < ButtonType > result = alert . showAndWait ( ) ; if ( result . get ( ) == alertButton1 ) { StartView sv = new StartView ( ) ; stage . close ( ) ; } if ( result . get ( ) == alertButton2 ) { stage . close ( ) ; } }
Creates an alert signaling that the game has ended.
Creates an alert signaling that the game has ended .