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:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user