mirror of
https://github.com/brianstrauch/solitaire-tui.git
synced 2024-11-16 07:47:52 +01:00
select a group of cards
This commit is contained in:
parent
975129b164
commit
968e52ab7b
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue