View/GamePVAIView.java
public void createRewardAlert(){
        Alert alert = new Alert(Alert.AlertType.NONE, "Congratulations " + getWinner()+ " you have earned a coin");
        if(getWinner().equals("Player 1")){
            user1.addCoin();
        }
        alert.getDialogPane().getStylesheets().add("/View/stylesheet.css");
        alert.setGraphic(new ImageView(new Image(getClass().getResourceAsStream("/View/Assets/CoinGif.gif"))));

        ButtonType alertButton1 = new ButtonType("Store");
        ButtonType alertButton2 = new ButtonType("Go Back");
        ButtonType alertButton3 = new ButtonType("Exit");
        alert.getButtonTypes().setAll(alertButton1,alertButton2,alertButton3);
        Optional<ButtonType> result = alert.showAndWait();

        if (result.get() == alertButton1){
           StoreView sv = new StoreView(user1);
           stage.close();
        }
        if (result.get() == alertButton2){
            StartView sv = new StartView();
            stage.close();
        }
        if (result.get() == alertButton3){
            stage.close();
        }

    }
/*Gives a coin to the winner of the game. Creates an alert
     *with a Coin gif animation and options to go to the store,
     *head back to the menu, or exit
     */
Gives a coin to the winner of the game. Creates an alert
with a Coin gif animation and options to go to the store,
head back to the menu, or exit
Gives a coin to the winner of the game . Creates an alert with a Coin gif animation and options to go to the store head back to the menu or exit
public void createRewardAlert(){
        Alert alert = new Alert(Alert.AlertType.NONE, "Congratulations " + getWinner()+ " you have earned a coin");
        if(getWinner().equals("Player 1")){
            user1.addCoin();
        }
        alert.getDialogPane().getStylesheets().add("/View/stylesheet.css");
        alert.setGraphic(new ImageView(new Image(getClass().getResourceAsStream("/View/Assets/CoinGif.gif"))));
        ButtonType alertButton1 = new ButtonType("Store");
        ButtonType alertButton2 = new ButtonType("Go Back");
        ButtonType alertButton3 = new ButtonType("Exit");
        alert.getButtonTypes().setAll(alertButton1,alertButton2,alertButton3);
        Optional<ButtonType> result = alert.showAndWait();
        if (result.get() == alertButton1){
           StoreView sv = new StoreView(user1);
           stage.close();
        }
        if (result.get() == alertButton2){
            StartView sv = new StartView();
            stage.close();
        }
        if (result.get() == alertButton3){
            stage.close();
        }
    }
public void createRewardAlert ( ) { Alert alert = new Alert ( Alert . AlertType . NONE , "Congratulations " + getWinner ( ) + " you have earned a coin" ) ; if ( getWinner ( ) . equals ( "Player 1" ) ) { user1 . addCoin ( ) ; } alert . getDialogPane ( ) . getStylesheets ( ) . add ( "/View/stylesheet.css" ) ; alert . setGraphic ( new ImageView ( new Image ( getClass ( ) . getResourceAsStream ( "/View/Assets/CoinGif.gif" ) ) ) ) ; ButtonType alertButton1 = new ButtonType ( "Store" ) ; ButtonType alertButton2 = new ButtonType ( "Go Back" ) ; ButtonType alertButton3 = new ButtonType ( "Exit" ) ; alert . getButtonTypes ( ) . setAll ( alertButton1 , alertButton2 , alertButton3 ) ; Optional < ButtonType > result = alert . showAndWait ( ) ; if ( result . get ( ) == alertButton1 ) { StoreView sv = new StoreView ( user1 ) ; stage . close ( ) ; } if ( result . get ( ) == alertButton2 ) { StartView sv = new StartView ( ) ; stage . close ( ) ; } if ( result . get ( ) == alertButton3 ) { stage . close ( ) ; } }
Gives a coin to the winner of the game.
Gives a coin to the winner of the game .