From 6f66a2e979b6300dea749716787f181cf0b0b7bb Mon Sep 17 00:00:00 2001 From: fdai7736 Date: Thu, 8 Feb 2024 12:28:04 +0100 Subject: [PATCH] add drawCard Btn --- .../java/de/hsfulda/onses/controllers/GameController.java | 5 +++++ src/main/resources/de/hsfulda/onses/views/game.fxml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/hsfulda/onses/controllers/GameController.java b/src/main/java/de/hsfulda/onses/controllers/GameController.java index fbf3b66..7ab7151 100644 --- a/src/main/java/de/hsfulda/onses/controllers/GameController.java +++ b/src/main/java/de/hsfulda/onses/controllers/GameController.java @@ -26,6 +26,7 @@ public class GameController implements Controller { final Pane enemyPane = (Pane) parent.lookup("#enemyPane"); final Pane playerPane = (Pane) parent.lookup("#playerPane"); final Button playButton = (Button) parent.lookup("#playCardBtn"); + final Button drawCardButton = (Button) parent.lookup("#drawCardBtn"); CardController lastPlayedCardController = new CardController(game.getLastPlayedCard(), null); PlayerController playerController = new PlayerController(gameService.getGame().getPlayerService().getPlayerList().getFirst()); @@ -50,6 +51,10 @@ public class GameController implements Controller { } }); + drawCardButton.setOnAction(e -> { + gameService.drawCard(1); + }); + lastPlayedCardPane.getChildren().add(lastPlayedCardController.render()); playerPane.getChildren().add(playerController.render()); diff --git a/src/main/resources/de/hsfulda/onses/views/game.fxml b/src/main/resources/de/hsfulda/onses/views/game.fxml index e0e8f23..892ce90 100644 --- a/src/main/resources/de/hsfulda/onses/views/game.fxml +++ b/src/main/resources/de/hsfulda/onses/views/game.fxml @@ -36,7 +36,7 @@ -