UNPKG

hathora-et-labora-game

Version:

Game logic reducer for Uwe Rosenberg's Ora et Labora

21 lines 497 B
import { GameStatusEnum } from '../types'; export const removeWonder = (state) => { if (state === undefined) return state; const wonders = state.wonders ?? 0; if (wonders === 0) return undefined; return { ...state, wonders: wonders - 1, }; }; export const gameEnd = (state) => { if (state === undefined) return state; return { ...state, status: GameStatusEnum.FINISHED, }; }; //# sourceMappingURL=state.js.map