From 486d3a2e2a215469677653ddb62307b7cd01cc1c Mon Sep 17 00:00:00 2001 From: Valentin Lucas <21901740@etu.unicaen.fr> Date: Tue, 7 Dec 2021 15:32:09 +0100 Subject: [PATCH] Modification de ButtonListener --- .../java/fr/lnl/game/client/listener/ButtonListener.java | 5 +++-- client/src/main/java/fr/lnl/game/client/view/Window.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/main/java/fr/lnl/game/client/listener/ButtonListener.java b/client/src/main/java/fr/lnl/game/client/listener/ButtonListener.java index 860c1f3..c95c65b 100644 --- a/client/src/main/java/fr/lnl/game/client/listener/ButtonListener.java +++ b/client/src/main/java/fr/lnl/game/client/listener/ButtonListener.java @@ -31,11 +31,12 @@ public class ButtonListener extends AbstractModelListening { public void updateModel(Object event) { Player player = game.getCurrentPlayer(); game.play(); + /* Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle("Un joueur ordinateur a joué"); alert.setHeaderText("Le joueur ordinateur numéro" + player.getId() + " a joué"); - alert.setContentText("Il a joué l'action: " + game.getSelectedAction()); + alert.setContentText("Il a joué l'action: " + game.getSelectedAction());*/ App.viewManager.updateView(); - alert.showAndWait(); + //alert.showAndWait(); } } diff --git a/client/src/main/java/fr/lnl/game/client/view/Window.java b/client/src/main/java/fr/lnl/game/client/view/Window.java index d821314..e6b03d6 100644 --- a/client/src/main/java/fr/lnl/game/client/view/Window.java +++ b/client/src/main/java/fr/lnl/game/client/view/Window.java @@ -105,7 +105,7 @@ public class Window extends AbstractView { StackPane subSp = new StackPane(); String s = "Joueur " + (playerNumber+1) + "\n" + "Energie : " + game.getPlayers().get(playerNumber).getEnergy() + "\n" + - "Arme : " + game.getPlayers().get(playerNumber).getWeapon() + "\n"; + "Arme : " + game.getPlayers().get(playerNumber).getWeapon().getClass().getSimpleName() + "\n"; Text t = new Text(s); Rectangle r = new Rectangle(); r.setWidth(500);