refactor(app): drop dead newSession param, unused import, restore main javadoc
- Remove unused `saves` parameter from `newSession(GameIO, SaveService)` → signature is now `newSession(GameIO)`, call site updated accordingly - Remove unused `import thb.jeanluc.adventure.menu.MenuAction` (switch uses unqualified constants; import was dead, compile confirmed clean) - Restore `/** Standard JVM entry point. @param args ignored */` Javadoc on `main` and restore full log message "Fatal error during game startup" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,6 @@ import thb.jeanluc.adventure.io.GameIO;
|
|||||||
import thb.jeanluc.adventure.io.text.Banner;
|
import thb.jeanluc.adventure.io.text.Banner;
|
||||||
import thb.jeanluc.adventure.loader.WorldLoader;
|
import thb.jeanluc.adventure.loader.WorldLoader;
|
||||||
import thb.jeanluc.adventure.menu.MainMenu;
|
import thb.jeanluc.adventure.menu.MainMenu;
|
||||||
import thb.jeanluc.adventure.menu.MenuAction;
|
|
||||||
import thb.jeanluc.adventure.menu.SettingsMenu;
|
import thb.jeanluc.adventure.menu.SettingsMenu;
|
||||||
import thb.jeanluc.adventure.save.SaveException;
|
import thb.jeanluc.adventure.save.SaveException;
|
||||||
import thb.jeanluc.adventure.save.SaveService;
|
import thb.jeanluc.adventure.save.SaveService;
|
||||||
@@ -48,12 +47,13 @@ public final class App {
|
|||||||
private App() {
|
private App() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Standard JVM entry point. @param args ignored */
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
GameIO io = new ConsoleIO();
|
GameIO io = new ConsoleIO();
|
||||||
try {
|
try {
|
||||||
run(io);
|
run(io);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
log.error("Fatal error", e);
|
log.error("Fatal error during game startup", e);
|
||||||
io.write("Fatal error: " + e.getMessage());
|
io.write("Fatal error: " + e.getMessage());
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ public final class App {
|
|||||||
boolean running = true;
|
boolean running = true;
|
||||||
while (running) {
|
while (running) {
|
||||||
switch (MainMenu.show(io)) {
|
switch (MainMenu.show(io)) {
|
||||||
case NEW_GAME -> play(io, saves, newSession(io, saves));
|
case NEW_GAME -> play(io, saves, newSession(io));
|
||||||
case LOAD -> {
|
case LOAD -> {
|
||||||
SaveSlotInfo slot = MainMenu.pickSlot(io, saves);
|
SaveSlotInfo slot = MainMenu.pickSlot(io, saves);
|
||||||
if (slot != null) {
|
if (slot != null) {
|
||||||
@@ -89,7 +89,7 @@ public final class App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Loads a fresh world and binds it to a newly named session. */
|
/** 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();
|
WorldLoader.LoadResult loaded = new WorldLoader().load();
|
||||||
String name = MainMenu.promptName(io, "Manor");
|
String name = MainMenu.promptName(io, "Manor");
|
||||||
return new GameSession(loaded.world(), loaded.player(), name);
|
return new GameSession(loaded.world(), loaded.player(), name);
|
||||||
|
|||||||
Reference in New Issue
Block a user