feat(game): push map to the IO each turn (GUI live update)

Game now derives the MapView from the world each turn; GameTest gains a
real World (the per-turn map push needs it).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 21:02:48 +02:00
parent fcf8083b7c
commit a0560a6ec5
2 changed files with 18 additions and 3 deletions

View File

@@ -6,6 +6,8 @@ import thb.jeanluc.adventure.command.CommandParser;
import thb.jeanluc.adventure.command.CommandRegistry;
import thb.jeanluc.adventure.command.ParsedCommand;
import thb.jeanluc.adventure.io.text.Hud;
import thb.jeanluc.adventure.io.text.MapView;
import thb.jeanluc.adventure.map.MapLayout;
import java.util.Optional;
@@ -63,6 +65,11 @@ public class Game {
ctx.getPlayer().getGold(),
turn,
false));
MapView map = MapLayout.compute(
ctx.getWorld(),
ctx.getPlayer().getVisitedRoomIds(),
ctx.getPlayer().getCurrentRoom());
ctx.getIo().setMap(map);
}
/**