Director.component
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 toncommands chosen by the engine's autoplay policy, each sent throughCore.cmdexactly as the UI sends them; stops at the run summary unlessopts.through. Returns{ played, phase, result, failures, version }.eventCounts()/missingEvents()— the audit of whichCore.EVENTSkinds 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.