fix move count

This commit is contained in:
2026-05-17 09:42:47 -07:00
parent b40fc4bf56
commit 74343d0c7a
+1 -2
View File
@@ -594,6 +594,7 @@ impl Game for Klondike {
config: &Self::Config, config: &Self::Config,
instruction: Self::Instruction, instruction: Self::Instruction,
) { ) {
stats.increment_moves();
match instruction { match instruction {
// Reset the stock if it's empty // Reset the stock if it's empty
KlondikeInstruction::RotateStock => { KlondikeInstruction::RotateStock => {
@@ -608,13 +609,11 @@ impl Game for Klondike {
} }
// Move a card from anywhere to a foundation // Move a card from anywhere to a foundation
KlondikeInstruction::DstFoundation(DstFoundation { src, foundation }) => { KlondikeInstruction::DstFoundation(DstFoundation { src, foundation }) => {
stats.increment_moves();
let card = self.state.take_top_card(src); let card = self.state.take_top_card(src);
self.state.extend_foundation(foundation, card); self.state.extend_foundation(foundation, card);
} }
// Move a stack of cards from anywhere to a tableau // Move a stack of cards from anywhere to a tableau
KlondikeInstruction::DstTableau(DstTableau { src, tableau }) => { KlondikeInstruction::DstTableau(DstTableau { src, tableau }) => {
stats.increment_moves();
let cards = self.state.take_stack(src); let cards = self.state.take_stack(src);
self.state.extend_tableau(tableau, cards); self.state.extend_tableau(tableau, cards);
} }