semesterprojekt: implement full text adventure (phases 1-7)

Walking skeleton through Swing GUI: YAML-driven world (4 rooms,
4 items, 1 NPC), HashMap command dispatch with parser, three-tier
item hierarchy (readable / switchable / plain), and end-to-end
NPC give/receive flow. 67 tests green.
This commit is contained in:
2026-05-25 21:37:59 +02:00
parent 9b6528d800
commit 83643a192f
85 changed files with 4453 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
package thb.jeanluc.adventure;
import lombok.extern.slf4j.Slf4j;
import thb.jeanluc.adventure.io.SwingIO;
import javax.swing.SwingUtilities;
/**
* Entry point for the Swing version of the game. The Swing window is
* built on the Event Dispatch Thread; the game loop itself runs in a
* background worker so that EDT events (typing) and blocking
* {@code readLine()} calls never deadlock each other.
*/
@Slf4j
public final class AppGui {
private AppGui() {
}
/**
* Standard JVM entry point.
*
* @param args ignored
*/
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
SwingIO io = new SwingIO("Haunted Manor");
Thread worker = new Thread(() -> {
try {
App.run(io);
} catch (RuntimeException e) {
log.error("Fatal error during game startup", e);
io.write("Fatal error: " + e.getMessage());
}
}, "game-loop");
worker.setDaemon(true);
worker.start();
});
}
}