feat(engine): Show solution — auto-play the winning line from the pause menu
Test / test (pull_request) Successful in 15m21s
Test / test (pull_request) Successful in 15m21s
New SolutionPlaybackPlugin: the pause modal's 'Show solution' button resumes the game and requests a solve of the live position via GameState::winning_line on AsyncComputeTaskPool (never blocks the main thread; stale results discarded via a move_count snapshot). The line then plays back one instruction per 0.45 s through the normal MoveRequestEvent / DrawRequestEvent pipeline — animations, scoring, undo history and win detection behave as if the player made the moves. Tableau run counts are decoded against the live state at step time. Playback cancels on Esc, pause, undo / new-game requests, and any rejected move (the signature of the player diverging the board). Toasts cover search start, line found, unwinnable, and budget- exhausted outcomes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,7 @@ pub mod safe_area;
|
||||
mod schedule_checks;
|
||||
pub mod selection_plugin;
|
||||
pub mod settings_plugin;
|
||||
pub mod solution_playback_plugin;
|
||||
pub mod splash_plugin;
|
||||
pub mod stats_plugin;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
@@ -161,6 +162,7 @@ pub use settings_plugin::{
|
||||
SettingsScreen, WINDOW_GEOMETRY_DEBOUNCE_SECS,
|
||||
};
|
||||
pub use solitaire_data::SyncProvider;
|
||||
pub use solution_playback_plugin::{SolutionPlayback, SolutionPlaybackPlugin, SolutionSolveTask};
|
||||
pub use splash_plugin::{SplashAge, SplashPlugin, SplashRoot};
|
||||
pub use stats_plugin::{
|
||||
LatestReplayPath, ReplayHistoryResource, ReplayNextButton, ReplayPrevButton,
|
||||
|
||||
Reference in New Issue
Block a user