diff --git a/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java b/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java index e20b232..8444308 100644 --- a/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java +++ b/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java @@ -26,7 +26,6 @@ import thb.jeanluc.adventure.io.GameIO; import thb.jeanluc.adventure.io.text.Banner; import thb.jeanluc.adventure.loader.WorldLoader; import thb.jeanluc.adventure.menu.MainMenu; -import thb.jeanluc.adventure.menu.MenuAction; import thb.jeanluc.adventure.menu.SettingsMenu; import thb.jeanluc.adventure.save.SaveException; import thb.jeanluc.adventure.save.SaveService; @@ -48,12 +47,13 @@ public final class App { private App() { } + /** Standard JVM entry point. @param args ignored */ public static void main(String[] args) { GameIO io = new ConsoleIO(); try { run(io); } catch (RuntimeException e) { - log.error("Fatal error", e); + log.error("Fatal error during game startup", e); io.write("Fatal error: " + e.getMessage()); System.exit(1); } @@ -70,7 +70,7 @@ public final class App { boolean running = true; while (running) { switch (MainMenu.show(io)) { - case NEW_GAME -> play(io, saves, newSession(io, saves)); + case NEW_GAME -> play(io, saves, newSession(io)); case LOAD -> { SaveSlotInfo slot = MainMenu.pickSlot(io, saves); if (slot != null) { @@ -89,7 +89,7 @@ public final class App { } /** Loads a fresh world and binds it to a newly named session. */ - private static GameSession newSession(GameIO io, SaveService saves) { + private static GameSession newSession(GameIO io) { WorldLoader.LoadResult loaded = new WorldLoader().load(); String name = MainMenu.promptName(io, "Manor"); return new GameSession(loaded.world(), loaded.player(), name);