From cac16d1725c46c82a2e62b84c93f7090b2ce0746 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 2 Oct 2026 17:51:46 -0400 Subject: feat: craps table color improvements, die improvements --- internal/casino/manager.go | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'internal/casino/manager.go') diff --git a/internal/casino/manager.go b/internal/casino/manager.go index 5fa6439..c9dde5a 100644 --- a/internal/casino/manager.go +++ b/internal/casino/manager.go @@ -10,7 +10,6 @@ import ( "strconv" "strings" "sync" - "time" ) type Manager struct { @@ -162,12 +161,10 @@ func (m *Manager) snapshotMachines() []*Machine { return machines } -func (m *Manager) Tick() []Event { return m.TickElapsed(600 * time.Millisecond) } - -// TickElapsed supplies the engine cadence to games with real-time deadlines. -// Legacy games retain their tick-based rules. No wall clock or goroutine is -// introduced, so owner ordering and deterministic tests remain intact. -func (m *Manager) TickElapsed(elapsed time.Duration) []Event { +// Tick advances every table and machine by one engine tick. Game rules are +// tick-based, so no wall-clock duration crosses this boundary; owner ordering +// and deterministic tests remain intact. +func (m *Manager) Tick() []Event { tables := m.snapshotTables() sort.Slice(tables, func(i, j int) bool { if tables[i].RoomID != tables[j].RoomID { @@ -177,11 +174,7 @@ func (m *Manager) TickElapsed(elapsed time.Duration) []Event { }) var events []Event for _, table := range tables { - if game, ok := table.game.(interface{ tickElapsed(time.Duration) []Event }); ok { - events = append(events, game.tickElapsed(elapsed)...) - } else { - events = append(events, table.tick()...) - } + events = append(events, table.tick()...) } machines := m.snapshotMachines() sort.Slice(machines, func(i, j int) bool { -- cgit v1.2.3