import { Phase } from "./enums.js"; import { PlanDayCommand } from "./StartDayCommand.js"; import { assert } from "./utils.js"; /** * @typedef {import('./game.js').GameState} GameState */ /** * Manages a single day in the bakery game */ export class Time { /** @type {GameState} */ game_state; /** @type {import("./game.js").Command[]} */ events; /** * @param {GameState} game_state - The current game state */ constructor(game_state) { this.game_state = game_state; this.events = []; } /** * Queues a command for execution * @param {import("./game.js").Command} command */ queue(command) { this.events.push(command); } /** * Updates the day timer * @param {number} dt - Delta time in milliseconds */ update(dt) { this.game_state.time.elapsed_ms += dt; for (const command of this.events) { this.game_state = command.execute(this.game_state); } } /** Renders the current day state */ render() {} } export { Day };