aboutsummaryrefslogtreecommitdiff
path: root/internal/game/blackjack_rules.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/blackjack_rules.go')
-rw-r--r--internal/game/blackjack_rules.go39
1 files changed, 10 insertions, 29 deletions
diff --git a/internal/game/blackjack_rules.go b/internal/game/blackjack_rules.go
index 045626c..7cea977 100644
--- a/internal/game/blackjack_rules.go
+++ b/internal/game/blackjack_rules.go
@@ -8,20 +8,26 @@ import (
)
// Tables are room fixtures in their own right, not authored scenery objects.
+// Each game resolves through the shared details view; the felt games append
+// their per-table rule card there.
func (g *Game) lookBlackjackTable(sess *net.Session, target string) bool {
- return g.lookCardTable(sess, target, casino.GameBlackjack)
+ return g.lookCasinoTable(sess, target, casino.GameBlackjack)
}
func (g *Game) lookBaccaratTable(sess *net.Session, target string) bool {
- return g.lookCardTable(sess, target, casino.GameBaccarat)
+ return g.lookCasinoTable(sess, target, casino.GameBaccarat)
}
func (g *Game) lookCrapsTable(sess *net.Session, target string) bool {
- return g.lookCardTable(sess, target, casino.GameCraps)
+ return g.lookCasinoTable(sess, target, casino.GameCraps)
}
func (g *Game) lookRouletteTable(sess *net.Session, target string) bool {
- return g.lookCardTable(sess, target, casino.GameRoulette)
+ return g.lookCasinoTable(sess, target, casino.GameRoulette)
+}
+
+func (g *Game) lookPaiGowTable(sess *net.Session, target string) bool {
+ return g.lookCasinoTable(sess, target, casino.GamePaiGow)
}
// A cabinet's published pay table is public; another player's cards are not.
@@ -56,28 +62,3 @@ func (g *Game) lookVideoPokerCabinet(sess *net.Session, target string) bool {
}
return false
}
-
-func (g *Game) lookCardTable(sess *net.Session, target string, game casino.GameName) bool {
- room, err := g.World.LoadRoom(sess.Player.RoomID)
- if err != nil {
- return false
- }
- target = strings.TrimSpace(strings.ToLower(target))
- for _, cfg := range room.CasinoTables {
- if cfg.Game != game {
- continue
- }
- id := strings.ToLower(cfg.ID)
- if target != string(game) && target != string(game)+" table" && target != id && target != id+" table" && !(target == "table" && len(room.CasinoTables) == 1) {
- continue
- }
- // Use the active configuration: live edits may be pending until a round ends.
- table, ok := g.casinoTable(room.ID, string(cfg.Game))
- if !ok {
- return false
- }
- sess.WriteLine(g.renderCasinoRules(sess, table.Config))
- return true
- }
- return false
-}