diff --git a/klondike-cli/src/main.rs b/klondike-cli/src/main.rs index 47b967d..85da347 100644 --- a/klondike-cli/src/main.rs +++ b/klondike-cli/src/main.rs @@ -222,7 +222,7 @@ fn get_good_move(state: &Klondike) -> Option { }) if !state.state().is_tableau_face_down_empty(tableau) || state .state() - .card(dst_tableau.src) + .stack_bottom_card(dst_tableau.src) .is_some_and(|card| card.value() != CardValue::KING) => { 2 diff --git a/klondike/src/lib.rs b/klondike/src/lib.rs index 09e91b0..c251336 100644 --- a/klondike/src/lib.rs +++ b/klondike/src/lib.rs @@ -327,7 +327,7 @@ impl KlondikeState { Tableau::Tableau7 => self.tableau7.face_down().is_empty(), } } - pub fn card(&self, src: KlondikePileStack) -> Option<&Card> { + pub fn stack_bottom_card(&self, src: KlondikePileStack) -> Option<&Card> { match src { KlondikePileStack::Tableau(TableauStack { tableau, @@ -444,7 +444,7 @@ impl KlondikeState { // other = move to tableau KlondikeInstruction::DstTableau(dst_tableau) => { // get the cards - if let Some(src_card) = self.card(dst_tableau.src) { + if let Some(src_card) = self.stack_bottom_card(dst_tableau.src) { match self.top_card(dst_tableau.tableau) { // destination card exists Some(dst_card) => {