diff options
| author | historia <[not public]> | 2026-10-02 17:51:46 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-02 17:51:46 -0400 |
| commit | cac16d1725c46c82a2e62b84c93f7090b2ce0746 (patch) | |
| tree | e54f6624bdeb47421587656757ef3ce4fd7ebb3f /internal/casino/manager.go | |
| parent | 4f40f116ba884111c9a66849e620ff9fbc67530a (diff) | |
| download | thehouseoficarus-cac16d1725c46c82a2e62b84c93f7090b2ce0746.tar.gz | |
feat: craps table color improvements, die improvements
Diffstat (limited to 'internal/casino/manager.go')
| -rw-r--r-- | internal/casino/manager.go | 17 |
1 files changed, 5 insertions, 12 deletions
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 { |
