draw 1 and fix bug

This commit is contained in:
Brian Strauch 2023-01-31 00:32:12 -08:00
parent 32847475aa
commit d8d6082484
2 changed files with 3 additions and 4 deletions

View file

@ -109,7 +109,7 @@ func (s *Solitaire) click(x, y int) {
switch deckTypes[i] { switch deckTypes[i] {
case stock: case stock:
if deck.Size() > 0 { if deck.Size() > 0 {
s.draw(3, deck, s.decks[waste]) s.draw(1, deck, s.decks[waste])
} else { } else {
s.draw(s.decks[waste].Size(), s.decks[waste], deck) s.draw(s.decks[waste].Size(), s.decks[waste], deck)
} }
@ -139,8 +139,7 @@ func (s *Solitaire) click(x, y int) {
} }
deck.Top().Flip() deck.Top().Flip()
} else if s.selected != nil && s.selected.deck != i { } else if s.selected != nil && s.selected.deck != i {
ok := s.move(&index{deck: i, card: j}) if !s.move(&index{deck: i, card: j}) && deck.Size() > 0 {
if !ok {
s.toggleSelect(nil) s.toggleSelect(nil)
s.toggleSelect(&index{deck: i, card: j}) s.toggleSelect(&index{deck: i, card: j})
} }

View file

@ -51,7 +51,7 @@ func (d *Deck) View() string {
// Outline // Outline
if d.Size() == 0 { if d.Size() == 0 {
return viewCard(" ", "", lipgloss.AdaptiveColor{Light: "#EEEEEE", Dark: "#888888"}) return viewCard(" ", "", lipgloss.AdaptiveColor{Light: "#CCCCCC", Dark: "#888888"})
} }
// Expanded cards // Expanded cards