Movement with only starting cards is mostly good
This commit is contained in:
@@ -376,6 +376,18 @@ impl Klondike {
|
||||
CardPosition::TopWaste | CardPosition::Foundation(_) => false
|
||||
}
|
||||
}
|
||||
|
||||
pub fn lowest_visible_card_in_pile_from_index(self, pile: usize, index: usize) -> usize {
|
||||
if self.piles[pile].len() == 0 {
|
||||
return 0;
|
||||
}
|
||||
for (i, card) in self.piles[pile].iter().skip(index).enumerate() {
|
||||
if card.visible {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
panic!("Pile with only facedown cards - this is wrong")
|
||||
}
|
||||
}
|
||||
|
||||
impl CardPosition {
|
||||
|
||||
Reference in New Issue
Block a user