import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;

/** start() only creates objects and connects them. No game logic, no drawing. */
public class KlondikeApp extends Application {
    @Override
    public void start(Stage stage) {
        KlondikeGame game = new KlondikeGame(42);
        GameView view = new GameView();
        KlondikeController controller = new KlondikeController(game, view);

        game.addListener(view);                                       // model -> view
        view.setController(controller);                               // view -> controller

        view.refresh(game);                                           // first drawing
        stage.setScene(new Scene(view));
        stage.setTitle("Klondike");
        stage.setResizable(false);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
