From 1dad15698845d370e998f7cc5feb8aece3fab58f Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 16 Sep 2026 17:05:17 -0400 Subject: refactor: remove dead code, consolidate save/error handling, add lint gate --- internal/casino/machine.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/casino/machine.go') diff --git a/internal/casino/machine.go b/internal/casino/machine.go index f156fe7..757588b 100644 --- a/internal/casino/machine.go +++ b/internal/casino/machine.go @@ -79,7 +79,7 @@ func (m *Machine) setBet(name string, amount int, wallet Wallet) []Event { if amount < m.Config.MinBet || amount > m.Config.MaxBet { return m.private(fmt.Sprintf("Slot machine bets must be %s.", betRangeText(m.Config.MinBet, m.Config.MaxBet))) } - return m.beginSpinLocked(name, amount, wallet, + return m.beginSpinLocked(amount, wallet, fmt.Sprintf("%s sets the bet to %d and pulls the lever.", name, amount), fmt.Sprintf("Bet set to %d. You pull the lever on the slots machine.", amount)) } @@ -99,12 +99,12 @@ func (m *Machine) start(name string, wallet Wallet) []Event { if m.bet <= 0 { return m.private("Set a wager first with 'bet '.") } - return m.beginSpinLocked(name, m.bet, wallet, + return m.beginSpinLocked(m.bet, wallet, fmt.Sprintf("%s pulls the lever on the slots machine.", name), "You pull the lever on the slots machine.") } -func (m *Machine) beginSpinLocked(name string, amount int, wallet Wallet, publicMessage, privateMessage string) []Event { +func (m *Machine) beginSpinLocked(amount int, wallet Wallet, publicMessage, privateMessage string) []Event { if _, err := wallet.Wager(amount); err != nil { return m.private(walletErrorMessage(err, "You don't have enough chips and credits for that bet.")) } -- cgit v1.2.3