rename function
This commit is contained in:
@@ -222,7 +222,7 @@ fn get_good_move(state: &Klondike) -> Option<KlondikeInstruction> {
|
|||||||
}) if !state.state().is_tableau_face_down_empty(tableau)
|
}) if !state.state().is_tableau_face_down_empty(tableau)
|
||||||
|| state
|
|| state
|
||||||
.state()
|
.state()
|
||||||
.card(dst_tableau.src)
|
.stack_bottom_card(dst_tableau.src)
|
||||||
.is_some_and(|card| card.value() != CardValue::KING) =>
|
.is_some_and(|card| card.value() != CardValue::KING) =>
|
||||||
{
|
{
|
||||||
2
|
2
|
||||||
|
|||||||
+2
-2
@@ -327,7 +327,7 @@ impl KlondikeState {
|
|||||||
Tableau::Tableau7 => self.tableau7.face_down().is_empty(),
|
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 {
|
match src {
|
||||||
KlondikePileStack::Tableau(TableauStack {
|
KlondikePileStack::Tableau(TableauStack {
|
||||||
tableau,
|
tableau,
|
||||||
@@ -444,7 +444,7 @@ impl KlondikeState {
|
|||||||
// other = move to tableau
|
// other = move to tableau
|
||||||
KlondikeInstruction::DstTableau(dst_tableau) => {
|
KlondikeInstruction::DstTableau(dst_tableau) => {
|
||||||
// get the cards
|
// 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) {
|
match self.top_card(dst_tableau.tableau) {
|
||||||
// destination card exists
|
// destination card exists
|
||||||
Some(dst_card) => {
|
Some(dst_card) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user