Summary
Several patterns are duplicated across scene controller subclasses (foraging.gd, crafting_chain.gd, team_capture.gd) that should be refactored into base_scene_controller.gd.
Duplicated Patterns
_input() handler - SPACE (start/stop), R (reset), S (step) keyboard handling is identical in all 3 scene controllers
_process() → _update_metrics_ui() - All 3 call _update_metrics_ui() from _process(). Could be a virtual method called from base class
_reset_scene() pattern - All 3 call simulation_manager.reset_simulation() and reset_backend_decisions(). A _on_scene_reset() hook could standardize this
_complete_scene() / _print_final_metrics() - Nearly identical completion guard + stop simulation + print metrics pattern
Context
Identified during Issue #64 (crafting system) implementation. Kept as a separate issue to keep #64 focused on crafting functionality.
Acceptance Criteria
Summary
Several patterns are duplicated across scene controller subclasses (
foraging.gd,crafting_chain.gd,team_capture.gd) that should be refactored intobase_scene_controller.gd.Duplicated Patterns
_input()handler - SPACE (start/stop), R (reset), S (step) keyboard handling is identical in all 3 scene controllers_process()→_update_metrics_ui()- All 3 call_update_metrics_ui()from_process(). Could be a virtual method called from base class_reset_scene()pattern - All 3 callsimulation_manager.reset_simulation()andreset_backend_decisions(). A_on_scene_reset()hook could standardize this_complete_scene()/_print_final_metrics()- Nearly identical completion guard + stop simulation + print metrics patternContext
Identified during Issue #64 (crafting system) implementation. Kept as a separate issue to keep #64 focused on crafting functionality.
Acceptance Criteria
_input()handler moved toSceneControllerbase class_process()calls virtual_update_metrics_ui()from base class_reset_scene()standardized with base class hook_complete_scene()pattern consolidated