//! Ferrous-specific scoring policy layered on top of upstream `klondike`. //! //! Upstream [`klondike::KlondikeStats::score`] owns the per-move point values //! (move-to-foundation, flip-up bonus, recycle penalty, etc.). The functions //! here are the Ferrous Solitaire house rules that upstream has no opinion on — //! currently just the win-time bonus shown in the win modal. /// Time bonus added to the score on a win: `700_000 / elapsed_seconds`. /// Returns 0 when `elapsed_seconds` is 0 to avoid division by zero. pub fn compute_time_bonus(elapsed_seconds: u64) -> i32 { if elapsed_seconds == 0 { return 0; } (700_000u64 / elapsed_seconds).min(i32::MAX as u64) as i32 }