UNPKG

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 674 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 Object.assign(Object.assign({}, player), { clergy, landscape: landscapeWithoutClergy }); })(state); }; //# sourceMappingURL=returnClergyIfPlaced.js.map