select a group of cards

This commit is contained in:
Brian Strauch 2023-01-16 15:35:55 -08:00
parent 975129b164
commit 968e52ab7b

View file

@ -224,11 +224,15 @@ func (s *Solitaire) move(to *index) bool {
func (s *Solitaire) toggleSelect(selected *index) {
if s.selected != nil {
s.decks[s.selected.deck].Get(s.selected.card).IsSelected = false
for _, card := range s.decks[s.selected.deck].GetFrom(s.selected.card) {
card.IsSelected = false
}
s.selected = nil
} else {
s.selected = selected
s.decks[s.selected.deck].Get(s.selected.card).IsSelected = true
for _, card := range s.decks[s.selected.deck].GetFrom(s.selected.card) {
card.IsSelected = true
}
}
}