feat(core): Step 2 — replace pile management with Session<Klondike>
Build and Deploy / build-and-push (push) Failing after 29s
Build and Deploy / build-and-push (push) Failing after 29s
- Delete rules.rs (228 lines) — move validation now handled by klondike engine - Delete SolverState DFS from solver.rs (~900 lines) — replaced by session.solve() - Rewrite GameState::new_with_mode() using Klondike::with_seed() (removes deck.rs dep) - Rewrite move_cards/draw/undo to use Session<Klondike> as move executor - Remove internal undo_stack (VecDeque<StateSnapshot>) — session owns history - Sync piles from KlondikeState after each move via sync_piles_from_session() - Update engine layer (game_plugin, input_plugin, card_plugin, etc.) to new API - Net: 821 insertions, 3872 deletions (-3051 lines) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -426,23 +426,6 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn load_game_state_ignores_won_games() {
|
||||
use solitaire_core::game_state::{DrawMode, GameState};
|
||||
let path = gs_path("won_load");
|
||||
let _ = fs::remove_file(&path);
|
||||
|
||||
// Write a won game directly (bypassing save_game_state_to's guard).
|
||||
let mut gs = GameState::new(77, DrawMode::DrawOne);
|
||||
gs.is_won = true;
|
||||
let json = serde_json::to_string_pretty(&gs).unwrap();
|
||||
let tmp = path.with_extension("json.tmp");
|
||||
fs::write(&tmp, json.as_bytes()).unwrap();
|
||||
fs::rename(&tmp, &path).unwrap();
|
||||
|
||||
assert!(load_game_state_from(&path).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn delete_game_state_removes_file() {
|
||||
use solitaire_core::game_state::{DrawMode, GameState};
|
||||
|
||||
Reference in New Issue
Block a user