mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 08:52:42 +00:00
Long expeditions D2-b: event-anchored day rollover
Splits the legacy briefing body into nightRolloverBurn + nightRolloverDrift, plus a processNightCamp convenience. For expeditions started after the new eventAnchoredCutoff, the 06:00 UTC briefing stops mutating: it posts a re-engagement DM, and only force-fires processNightCamp itself after a 28h safety-net window. Day++/burn/threat-drift now ride along the autopilot night-camp pitch (decideAutopilotCamp sets Night=true when ≥16h since the last rollover) and on the first player !camp since the last rollover. The legacy UTC-anchored flow still works via the same staged helpers, with processOvernightCamp interleaved to preserve the rest-before-drift ordering. Tests pin eventAnchoredCutoff to year 9999 in TestMain so the existing legacy assertions still run; new tests cover the night decision, the night-camp pitch advancing the day, the event-anchored skip, and the safety-net force-rollover.
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/chehsunliu/poker"
|
||||
)
|
||||
@@ -30,6 +31,11 @@ func loadSolverFixture() {
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
loadSolverFixture()
|
||||
// D2-b: shove eventAnchoredCutoff far into the future so existing tests
|
||||
// keep exercising the legacy UTC-anchored briefing mutator path by
|
||||
// default. New event-anchored tests opt in by overriding the cutoff
|
||||
// (see useEventAnchored helpers).
|
||||
eventAnchoredCutoff = time.Date(9999, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user