Implement Stats #6

Merged
Quaternions merged 6 commits from stats into master 2026-05-17 16:46:09 +00:00
Showing only changes of commit 74343d0c7a - Show all commits
+1 -2
View File
@@ -594,6 +594,7 @@ impl Game for Klondike {
config: &Self::Config,
instruction: Self::Instruction,
) {
stats.increment_moves();
match instruction {
// Reset the stock if it's empty
KlondikeInstruction::RotateStock => {
@@ -608,13 +609,11 @@ impl Game for Klondike {
}
// Move a card from anywhere to a foundation
KlondikeInstruction::DstFoundation(DstFoundation { src, foundation }) => {
stats.increment_moves();
let card = self.state.take_top_card(src);
self.state.extend_foundation(foundation, card);
}
// Move a stack of cards from anywhere to a tableau
KlondikeInstruction::DstTableau(DstTableau { src, tableau }) => {
stats.increment_moves();
let cards = self.state.take_stack(src);
self.state.extend_tableau(tableau, cards);
}