From 422b0a496295a1e7296c161191f9b303674a68b3 Mon Sep 17 00:00:00 2001 From: Valentin Lucas <21901740@etu.unicaen.fr> Date: Tue, 7 Dec 2021 16:03:02 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20du=20num=C3=A9ro=20du=20joueur=20+?= =?UTF-8?q?=20factorisation=20de=20quelques=20m=C3=A9thodes=20de=20window?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/fr/lnl/game/client/view/Window.java | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) 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 e6b03d6..8318351 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 @@ -15,7 +15,9 @@ import javafx.scene.layout.Pane; import javafx.scene.layout.StackPane; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; +import javafx.scene.text.Font; import javafx.scene.text.Text; +import javafx.scene.text.TextAlignment; import javafx.stage.Stage; public class Window extends AbstractView { @@ -64,18 +66,14 @@ public class Window extends AbstractView { } } putStatePlayerPane(principalPane); - StackPane stateMoveTextPane = showMoveText(); - stateMoveTextPane.setLayoutY(480); - principalPane.getChildren().add(stateMoveTextPane); - - - Button followingButton = new Button("SUIVANT"); - followingButton.setOnAction(new ClientEventHandler(new ButtonListener(game))); - followingButton.setLayoutX(700); - followingButton.setLayoutY(600); - followingButton.setStyle("-fx-background-color: #a96806;"); - followingButton.setTextFill(javafx.scene.paint.Color.WHITE); - principalPane.getChildren().add(followingButton); + putMoveTextPane(principalPane); + Button buttonNext = new Button("SUIVANT"); + buttonNext .setOnAction(new ClientEventHandler(new ButtonListener(game))); + buttonNext .setLayoutX(700); + buttonNext .setLayoutY(600); + buttonNext .setStyle("-fx-background-color: #a96806;"); + buttonNext .setTextFill(javafx.scene.paint.Color.WHITE); + principalPane.getChildren().add(buttonNext); return principalPane; } @@ -87,12 +85,12 @@ public class Window extends AbstractView { } // TODO: 07/12/2021 WARNING : générer autant de frames qu’il y a de joueurs,(à implémenter) - // TODO: 07/12/2021 Maintenant régler : Factorisation du code, Responsive + // TODO: 07/12/2021 Maintenant régler : Responsive + - //à voir si on peut faire plus proprement les deux méthodes en dessous avec une List ? public void putStatePlayerPane(Pane principalPane){ int Y = 0; - for(int i=0;i < game.getPlayers().size();i++){ + for(int i=0;i