UNPKG

hathora-et-labora-game

Version:

Game logic reducer for Uwe Rosenberg's Ora et Labora

19 lines 688 B
import { map } from 'ramda'; import { clergyForColor, withEachPlayer } from '../player'; import { tileWithoutClergy } from '../tile'; export const returnClergyIfPlaced = (state) => { if (state === undefined) return undefined; return withEachPlayer((player) => { if (player.clergy.length > 0) return player; const clergy = clergyForColor(state.config)(player.color); const landscapeWithoutClergy = map(map(tileWithoutClergy(clergy)))(player.landscape); return { ...player, clergy, landscape: landscapeWithoutClergy, }; })(state); }; //# sourceMappingURL=returnClergyIfPlaced.js.map