import { Phase } from "./enums"; import { assert } from "./utils"; export class PlanDayCommand { /** * Executes the plan day command * @param {import(".").GameState} game_state * @returns {import(".").GameState} */ execute(game_state) { assert( game_state.time.phase === Phase.CLOSE, "store must be closed before you can plan", ); return { ...game_state, time: { ...game_state.time, day: game_state.time.day + 1, phase: Phase.PLANNING, }, }; } }