diff --git a/src/main/java/de/hsfulda/onses/controllers/GameController.java b/src/main/java/de/hsfulda/onses/controllers/GameController.java index ce78ffe..8d3a550 100644 --- a/src/main/java/de/hsfulda/onses/controllers/GameController.java +++ b/src/main/java/de/hsfulda/onses/controllers/GameController.java @@ -28,8 +28,8 @@ public class GameController implements Controller { final Button playButton = (Button) parent.lookup("#playCardBtn"); CardController lastPlayedCardController = new CardController(new Card().setValue(Card.Value.FIVE).setColor(Card.Color.BLUE)); - PlayerController playerController = new PlayerController(); - PlayerController enemyController = new PlayerController(); + PlayerController playerController = new PlayerController(gameService.getGame().getPlayerService().getPlayerList().getFirst()); + PlayerController enemyController = new PlayerController(gameService.getGame().getPlayerService().getPlayerList().getLast()); game.listeners().addPropertyChangeListener(Game.PROPERTY_LAST_PLAYED_CARD, e -> { lastPlayedCardPane.getChildren().removeAll(); diff --git a/src/main/java/de/hsfulda/onses/controllers/PlayerController.java b/src/main/java/de/hsfulda/onses/controllers/PlayerController.java index 7cdb72f..72497b8 100644 --- a/src/main/java/de/hsfulda/onses/controllers/PlayerController.java +++ b/src/main/java/de/hsfulda/onses/controllers/PlayerController.java @@ -1,16 +1,27 @@ package de.hsfulda.onses.controllers; import de.hsfulda.onses.Main; +import de.hsfulda.onses.models.Player; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; +import javafx.scene.control.Label; import java.io.IOException; import java.util.Objects; public class PlayerController implements Controller { + + private final Player player; + + public PlayerController(Player player) { + this.player = player; + } @Override public Parent render() throws IOException { final Parent parent = FXMLLoader.load(Objects.requireNonNull(Main.class.getResource("views/player.fxml"))); + final Label playerNameLabel = (Label) parent.lookup("#playerNameLabel"); + + playerNameLabel.setText("Test"); return parent; }