fdai7736
11 months ago
4 changed files with 47 additions and 16 deletions
-
6src/main/java/de/hsfulda/onses/App.java
-
10src/main/java/de/hsfulda/onses/controllers/AppController.java
-
14src/main/java/de/hsfulda/onses/controllers/GameController.java
-
33src/main/resources/de/hsfulda/onses/views/game.fxml
@ -1,21 +1,27 @@ |
|||
package de.hsfulda.onses.controllers; |
|||
|
|||
import de.hsfulda.onses.Main; |
|||
import de.hsfulda.onses.models.Game; |
|||
import de.hsfulda.onses.models.Card; |
|||
import de.hsfulda.onses.services.GameService; |
|||
import javafx.fxml.FXMLLoader; |
|||
import javafx.scene.Parent; |
|||
import javafx.scene.layout.Pane; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.Objects; |
|||
|
|||
public class GameController implements Controller { |
|||
private final Game game; |
|||
public GameController(Game game) { |
|||
this.game = game; |
|||
private final GameService gameService; |
|||
public GameController(GameService gameService) { |
|||
this.gameService = gameService; |
|||
} |
|||
@Override |
|||
public Parent render() throws IOException { |
|||
final Parent parent = FXMLLoader.load(Objects.requireNonNull(Main.class.getResource("views/game.fxml"))); |
|||
CardController lastPlayedCardController = new CardController(new Card().setValue(Card.Value.FIVE).setColor(Card.Color.BLUE)); |
|||
|
|||
Pane lastPlayedCardPane = (Pane) parent.lookup("#lastPlayedCardPane"); |
|||
lastPlayedCardPane.getChildren().add(lastPlayedCardController.render()); |
|||
|
|||
return parent; |
|||
} |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue