diff options
Diffstat (limited to 'server/lib/core/state')
| -rw-r--r-- | server/lib/core/state/game_state.dart | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/lib/core/state/game_state.dart b/server/lib/core/state/game_state.dart index a6884cc..23666fe 100644 --- a/server/lib/core/state/game_state.dart +++ b/server/lib/core/state/game_state.dart @@ -152,10 +152,17 @@ class GameState { List<String> get commandDescriptions => _actionHandler.commandDescriptions; List<GameSaveState?> get gameSaveStates => _actionHandler.gameSaveStates; - /// The Phase 2 broadcast hook is reachable through the action handler. + /// The Phase 2 broadcast hook, reachable through the action handler: set + /// by the network layer, null in headless tests. void Function(int index, String description, String eventJson)? get onAction => _actionHandler.onAction; + set onAction( + void Function(int index, String description, String eventJson)? value, + ) { + _actionHandler.onAction = value; + } + // Minimal observer hook — replaces the reference app's ChangeNotifier // notifications. The network layer (Phase 2) subscribes; unused in Phase 1. final List<void Function()> _listeners = []; |
