Log inGet started
Package

Director.component

Newest version

README.md

Director

The referee of ROGUE ICE and the only writer of Core.state(). It sits on the scene's Director anchor and binds a game.rules.Engine instance to Core.state(), Core.emit and Core.touch (persistence on), then answers every Core.cmd(name, payload) in Core.COMMANDS: the season map, matches, off-ice events, trade desk, rewards, economy and meta progression (Prestige, achievements and unlocks persisted in runtime_data via game.rules.Meta). It emits every Core.EVENTS event with the spec's payloads. A refused command leaves state.notice = { command, text, at } for the UI to toast.

Methods (call on the component ref, e.g. entity("Director").component.get("game.rules.Director"):autoplay(400)):

  • autoplay(n, opts?) — plays up to n commands chosen by the engine's autoplay policy, each sent through Core.cmd exactly as the UI sends them; stops at the run summary unless opts.through. Returns { played, phase, result, failures, version }.
  • eventCounts() / missingEvents() — the audit of which Core.EVENTS kinds have fired since it bound.
  • resetProgress() — wipe saved meta progression and the saved run (debug).

Public fields commands, rejected, lastCommand show what it last did. See /zero/source/design/spec.md.