diff options
| author | historia <[not public]> | 2026-09-19 03:15:59 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-19 03:15:59 -0400 |
| commit | 0e60567a7a0addb9421769ee7be7853bfa8788cb (patch) | |
| tree | 7645112db0e4eae95b8a83c1e4f9aab38bede655 /internal/casino/types.go | |
| parent | cc33072eced3d5460512c09c42ec4531c807d7af (diff) | |
| download | thehouseoficarus-0e60567a7a0addb9421769ee7be7853bfa8788cb.tar.gz | |
refactor: simplifcation, change how rooms are stored in player yaml, remove legacy code
Diffstat (limited to 'internal/casino/types.go')
| -rw-r--r-- | internal/casino/types.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/internal/casino/types.go b/internal/casino/types.go index e057ba6..2d4ba02 100644 --- a/internal/casino/types.go +++ b/internal/casino/types.go @@ -129,13 +129,6 @@ type MachineConfig struct { Payout float64 `yaml:"payout,omitempty"` } -// LegacySlotMachine converts a legacy slots TableConfig (older rooms declared -// slots under casino_tables) into the MachineConfig the room actually -// instantiates. Shared by validation and room lookup so the two cannot drift. -func LegacySlotMachine(c TableConfig) MachineConfig { - return MachineConfig{ID: c.ID, Game: GameSlots, MinBet: c.MinBet, MaxBet: c.MaxBet} -} - func (c MachineConfig) Normalize() MachineConfig { if c.MinBet <= 0 { c.MinBet = 1 @@ -216,6 +209,10 @@ type Wallet interface { // ResolveStake consumes ONE pending stake by wallet handle (a single // hand paid or lost while a sibling hand's round is still in flight). ResolveStake(stakeID string) + // ResolveStakesByIDs consumes the listed pending stakes in ONE save. It is + // the batched form of ResolveStake used when a losing round has several + // stakes (split/double hands) so they are not committed one save at a time. + ResolveStakesByIDs(stakeIDs ...string) // RefundOutstanding returns every pending stake to the player (chips as // chips, credits as credits) and clears the ledger. An error means the // refund could not be made durable: nothing was returned and the stakes |
