major refactor(game-modes): centralize scoring and turn handling

* Move common ball recording, scoring, and turn-switching logic into `BaseMode`
* Add hooks for mode-specific ball handling and turn behavior
* Simplify 8-ball and 9-ball modes to use `LastBallMode`
* Update Snooker to use the new ball-processing hooks
* Remove duplicated scoring and turn-management code
This commit is contained in:
2026-08-13 00:16:09 -05:00
parent 7be84d8591
commit 409680b94a
8 changed files with 126 additions and 240 deletions

View File

@@ -21,5 +21,5 @@ func _balls_stopped_moving() -> void:
mode.handle_switch_user()
func set_mode(game_mode) -> void:
mode = Globals.game_data.GameMode.get(game_mode).new()
mode = Globals.game_data.GameMode.get(game_mode).new()
mode.ball_states = mode.generate_ball_states()