|
@ -1,29 +1,34 @@ |
|
|
package de.hsfulda.onses.controllers; |
|
|
package de.hsfulda.onses.controllers; |
|
|
|
|
|
|
|
|
import de.hsfulda.onses.Main; |
|
|
import de.hsfulda.onses.Main; |
|
|
|
|
|
import de.hsfulda.onses.models.Card; |
|
|
import de.hsfulda.onses.models.Game; |
|
|
import de.hsfulda.onses.models.Game; |
|
|
import javafx.fxml.FXMLLoader; |
|
|
import javafx.fxml.FXMLLoader; |
|
|
import javafx.scene.Parent; |
|
|
import javafx.scene.Parent; |
|
|
|
|
|
import javafx.scene.Scene; |
|
|
import javafx.scene.control.Button; |
|
|
import javafx.scene.control.Button; |
|
|
|
|
|
import javafx.stage.Stage; |
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.Objects; |
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
public class AppController implements Controller { |
|
|
public class AppController implements Controller { |
|
|
|
|
|
|
|
|
private final Game game; |
|
|
private final Game game; |
|
|
|
|
|
private final Stage stage; |
|
|
|
|
|
|
|
|
public AppController(Game game) { |
|
|
|
|
|
|
|
|
public AppController(Game game, Stage stage) { |
|
|
this.game = game; |
|
|
this.game = game; |
|
|
|
|
|
this.stage = stage; |
|
|
} |
|
|
} |
|
|
@Override |
|
|
@Override |
|
|
public Parent render() throws IOException { |
|
|
public Parent render() throws IOException { |
|
|
final Parent parent = FXMLLoader.load(Main.class.getResource("views/app.fxml")); |
|
|
|
|
|
|
|
|
GameController gameController = new GameController(game); |
|
|
|
|
|
final Parent parent = FXMLLoader.load(Objects.requireNonNull(Main.class.getResource("views/app.fxml"))); |
|
|
Button button = (Button) parent.lookup("#startGameBtn"); |
|
|
Button button = (Button) parent.lookup("#startGameBtn"); |
|
|
|
|
|
|
|
|
button.setOnAction(e -> { |
|
|
|
|
|
System.out.println("Pressed"); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return parent; |
|
|
return parent; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |