package de.nowchess.backcore

import de.nowchess.backcore.game.{GameEngineHolder, GameId}
import de.nowchess.ui.gui.ChessGUILauncher
import de.nowchess.ui.terminal.TerminalUI
import io.quarkus.runtime.annotations.QuarkusMain
import io.quarkus.runtime.{Quarkus, QuarkusApplication}

@QuarkusMain
class AppMain extends QuarkusApplication:
  override def run(args: String*): Int =
    val engine = GameEngineHolder.engine
    println(s"REST API -> http://localhost:8080/api/board/game/${GameEngineHolder.gameId}")
    ChessGUILauncher.launch(engine)
    new TerminalUI(engine).start()
    Quarkus.asyncExit()
    0
