// Fa avanzare il gioco come farebbe un giocatore impaziente: tempo che scorre e battute saltate. export function settle(game, { maxSteps = 20000 } = {}) { const said = []; for (let i = 0; i < maxSteps; i++) { if (game.speech) { said.push(game.speech); game.skip(); } if (!game.busy && !game.walking && !game.queue.length && !game.task) return said; game.update(0.05); } throw new Error('Il gioco non si ferma: ' + JSON.stringify(game.snapshot())); } export function memoryStorage() { return { data: {}, getItem(k) { return this.data[k] ?? null; }, setItem(k, v) { this.data[k] = String(v); }, removeItem(k) { delete this.data[k]; } }; }