refactor(engine,wasm,data): route all klondike/card_game imports through solitaire_core
All downstream crates now import Foundation, KlondikePile, Tableau, Klondike, Session, Suit, Rank exclusively from solitaire_core. solitaire_core is the single version-pin point for the upstream crates. - solitaire_engine: 19 files updated, klondike direct dep removed - solitaire_wasm: use statement updated, klondike direct dep removed - solitaire_data: unused klondike dep removed - Cargo.lock: klondike no longer a direct dep of engine/wasm/data - Full workspace clippy clean, all tests pass Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ use chrono::Utc;
|
||||
use bevy::prelude::*;
|
||||
use bevy::tasks::{AsyncComputeTaskPool, Task, futures_lite::future};
|
||||
use bevy::window::AppLifecycle;
|
||||
use klondike::KlondikePile;
|
||||
use solitaire_core::KlondikePile;
|
||||
use solitaire_core::game_state::{DrawMode, GameMode, GameState};
|
||||
use solitaire_core::solver::{SolverConfig, SolverResult, try_solve};
|
||||
#[allow(deprecated)]
|
||||
@@ -521,7 +521,7 @@ fn handle_new_game(
|
||||
// hides that information and reads naturally as "dealt from the
|
||||
// deck." Skipped when LayoutResource isn't present (headless tests).
|
||||
if let Some(layout) = layout.as_ref()
|
||||
&& let Some(stock) = layout.0.pile_positions.get(&klondike::KlondikePile::Stock)
|
||||
&& let Some(stock) = layout.0.pile_positions.get(&solitaire_core::KlondikePile::Stock)
|
||||
{
|
||||
for mut tx in &mut card_transforms {
|
||||
tx.translation.x = stock.x;
|
||||
@@ -1014,12 +1014,12 @@ fn pile_cards(game: &GameState, pile: &KlondikePile) -> Vec<solitaire_core::card
|
||||
}
|
||||
}
|
||||
|
||||
fn foundation_slot(foundation: klondike::Foundation) -> Option<u8> {
|
||||
fn foundation_slot(foundation: solitaire_core::Foundation) -> Option<u8> {
|
||||
match foundation {
|
||||
klondike::Foundation::Foundation1 => Some(0),
|
||||
klondike::Foundation::Foundation2 => Some(1),
|
||||
klondike::Foundation::Foundation3 => Some(2),
|
||||
klondike::Foundation::Foundation4 => Some(3),
|
||||
solitaire_core::Foundation::Foundation1 => Some(0),
|
||||
solitaire_core::Foundation::Foundation2 => Some(1),
|
||||
solitaire_core::Foundation::Foundation3 => Some(2),
|
||||
solitaire_core::Foundation::Foundation4 => Some(3),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1294,7 +1294,7 @@ fn save_game_state_on_exit(
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use klondike::{Foundation, KlondikePile, Tableau};
|
||||
use solitaire_core::{Foundation, KlondikePile, Tableau};
|
||||
use solitaire_core::klondike_adapter::{SavedKlondikePile, SavedTableau};
|
||||
|
||||
/// Build a minimal headless `App` with just `GamePlugin` installed.
|
||||
@@ -1423,8 +1423,10 @@ mod tests {
|
||||
"fresh game should inherit default take_from_foundation=true",
|
||||
);
|
||||
|
||||
let mut settings = solitaire_data::Settings::default();
|
||||
settings.take_from_foundation = false;
|
||||
let mut settings = solitaire_data::Settings {
|
||||
take_from_foundation: false,
|
||||
..Default::default()
|
||||
};
|
||||
app.world_mut()
|
||||
.write_message(crate::settings_plugin::SettingsChangedEvent(
|
||||
settings.clone(),
|
||||
@@ -1951,15 +1953,15 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// Verify that the game-over overlay contains the expected header text and
|
||||
/// action-hint strings so players understand why the overlay appeared and
|
||||
/// what keys to press.
|
||||
// Verify that the game-over overlay contains the expected header text and
|
||||
// action-hint strings so players understand why the overlay appeared and
|
||||
// what keys to press.
|
||||
// -----------------------------------------------------------------------
|
||||
// Task #56 — Escape dismisses GameOverScreen and starts new game
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
/// Pressing Escape while `GameOverScreen` is visible must fire
|
||||
/// `NewGameRequestEvent` — identical behaviour to pressing N.
|
||||
// Pressing Escape while `GameOverScreen` is visible must fire
|
||||
// `NewGameRequestEvent` — identical behaviour to pressing N.
|
||||
// -----------------------------------------------------------------------
|
||||
// Task #48 — Undo with empty stack fires InfoToastEvent
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user