hathora-et-labora-game
Version:
Plays Uwe Rosenberg's Ora et Labora for the Hathora engine. It reduces a list of moves into a board game state.
15 lines • 508 B
JavaScript
import { GameStatusEnum } from '../types';
export const removeWonder = (state) => {
if (state === undefined)
return state;
const { wonders } = state;
if (wonders === 0)
return undefined;
return Object.assign(Object.assign({}, state), { wonders: wonders - 1 });
};
export const gameEnd = (state) => {
if (state === undefined)
return state;
return Object.assign(Object.assign({}, state), { status: GameStatusEnum.FINISHED });
};
//# sourceMappingURL=state.js.map