diff options
| author | historia <[not public]> | 2026-08-03 16:18:17 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-08-03 16:19:25 -0400 |
| commit | f2c4a58727169a03b8102704888d1579d26b28c8 (patch) | |
| tree | a334f9cd37b3c7521c11d266d797b208dac4f3be /internal/casino/types.go | |
| parent | 612e429de438821ae8e099d6b54f87c11ff6c1b5 (diff) | |
| download | thehouseoficarus-f2c4a58727169a03b8102704888d1579d26b28c8.tar.gz | |
feat: multiplayer baccarat game
Diffstat (limited to 'internal/casino/types.go')
| -rw-r--r-- | internal/casino/types.go | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/internal/casino/types.go b/internal/casino/types.go index 1c4326a..c28b471 100644 --- a/internal/casino/types.go +++ b/internal/casino/types.go @@ -5,6 +5,7 @@ type GameName string const ( GameSlots GameName = "slots" GameBlackjack GameName = "blackjack" + GameBaccarat GameName = "baccarat" ) type BlackjackConfig struct { @@ -60,6 +61,32 @@ func (c BlackjackConfig) Normalize() BlackjackConfig { return c } +// BaccaratConfig holds punto banco house rules: shoe composition and payout +// multipliers. Banker wins pay BankerPayout:1 (a 5% commission game is 0.95); +// tie wins pay TiePayout:1. +type BaccaratConfig struct { + Decks int `yaml:"decks,omitempty"` + ShuffleAt float64 `yaml:"shuffle_at,omitempty"` + TiePayout float64 `yaml:"tie_payout,omitempty"` + BankerPayout float64 `yaml:"banker_payout,omitempty"` +} + +func (c BaccaratConfig) Normalize() BaccaratConfig { + if c.Decks <= 0 { + c.Decks = 8 + } + if c.ShuffleAt <= 0 || c.ShuffleAt >= 1 { + c.ShuffleAt = 0.25 + } + if c.TiePayout <= 0 { + c.TiePayout = 8 + } + if c.BankerPayout <= 0 { + c.BankerPayout = 0.95 + } + return c +} + type TableConfig struct { ID string `yaml:"id"` Game GameName `yaml:"game"` @@ -68,6 +95,7 @@ type TableConfig struct { MinBet int `yaml:"min_bet,omitempty"` MaxBet int `yaml:"max_bet,omitempty"` Blackjack BlackjackConfig `yaml:"blackjack,omitempty"` + Baccarat BaccaratConfig `yaml:"baccarat,omitempty"` } type MachineConfig struct { @@ -146,6 +174,7 @@ const ( MenuSlotCommands MenuKind = "slot_commands" MenuBlackjackBet MenuKind = "blackjack_bet" MenuBlackjackTurn MenuKind = "blackjack_turn" + MenuBaccaratBet MenuKind = "baccarat_bet" ) // MenuView carries a structured menu alongside its plain-text Message so the @@ -170,6 +199,7 @@ type Event struct { Public bool Slot *SlotSnapshot Blackjack *BlackjackSnapshot + Baccarat *BaccaratSnapshot Menu *MenuView } @@ -178,7 +208,8 @@ type SlotSnapshot struct { StoppedReels int } -type BlackjackCardView struct { +// CardView renders one card for any card-based table game. +type CardView struct { Rank string Suit string Hidden bool @@ -186,18 +217,33 @@ type BlackjackCardView struct { type BlackjackPlayerView struct { Name string - Cards []BlackjackCardView + Cards []CardView Score string } type BlackjackSnapshot struct { - Dealer []BlackjackCardView + Dealer []CardView DealerShownScore string DealerScore string DealerRevealed bool Players []BlackjackPlayerView } +// BaccaratBetView lists one participant's wager on a baccarat outcome. +type BaccaratBetView struct { + Name string + Spot string + Amount int +} + +type BaccaratSnapshot struct { + Player []CardView + Banker []CardView + PlayerScore string + BankerScore string + Bets []BaccaratBetView +} + type Participant struct { Name string Connected bool |
