package eu.oschl.schmorn;

import eu.oschl.textadventure.Game;

/**
 * Serves as an entry point, handles starting either CLI or GUI version of the game.
 *
 * @author Ondřej Schlaichert
 */
class Main {
    static void main(String[] args) {
        var useCli = args.length > 0 && args[0].equalsIgnoreCase("--cli");

        var game = Setup.createGame();

        if (useCli) {
            startCli(game);
        } else {
            startGui(game, args);
        }
    }

    private static void startCli(Game game) {
        var session = new eu.oschl.cli.Session(game);
        session.start();
    }

    private static void startGui(Game game, String[] args) {
        eu.oschl.gui.Session.launchGui(game, args);
    }
}