feat: export beacon state snapshots for #166
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Successful in 3s
Smoke Test / smoke (pull_request) Failing after 6s

This commit is contained in:
Alexander Whitestone
2026-04-17 02:47:20 -04:00
parent 36f84c1f97
commit 6d4b8d86f3
3 changed files with 123 additions and 0 deletions

View File

@@ -230,6 +230,10 @@ function tick() {
G.lastEventAt = G.tick;
}
if (typeof StateExport !== 'undefined' && StateExport && typeof StateExport.onTickBoundary === 'function') {
StateExport.onTickBoundary(G);
}
// Emergent mechanics: track resource state and check for emergent events
if (typeof EmergentMechanics !== 'undefined' && window._emergent) {
if (Math.floor(G.tick * 10) % 100 === 0) { // every ~10 seconds