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.
19 lines • 690 B
JavaScript
import { always, curry, xor } from 'ramda';
import { P, match } from 'ts-pattern';
import { getCost, withActivePlayer } from '../board/player';
import { parseResourceParam } from '../board/resource';
export const falseLighthouse = (param = '') => {
const { whiskey = 0, beer = 0 } = parseResourceParam(param);
if (!xor(whiskey === 1, beer === 1))
return () => undefined;
return withActivePlayer(getCost({
penny: 3,
whiskey,
beer,
}));
};
export const complete = curry((partial, state) => match(partial)
.with([], always(['Be', 'Wh']))
.with([P._], always(['']))
.otherwise(always([])));
//# sourceMappingURL=falseLighthouse.js.map