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.
16 lines • 828 B
JavaScript
import { withRondel } from '../rondel';
const pushArm = (expireAfterTen = false) => withRondel((rondel) => {
const next = (rondel.pointingBefore + 1) % 13;
const bumper = (from) => {
if (from === next) {
if (expireAfterTen)
return undefined;
return (from + 1) % 13;
}
return from;
};
return Object.assign(Object.assign({}, rondel), { pointingBefore: next, grain: bumper(rondel.grain), sheep: bumper(rondel.sheep), clay: bumper(rondel.clay), coin: bumper(rondel.coin), wood: bumper(rondel.wood), joker: bumper(rondel.joker), peat: bumper(rondel.peat), grape: bumper(rondel.grape), stone: bumper(rondel.stone) });
});
export const rotateRondel = pushArm();
export const rotateRondelWithExpire = pushArm(true);
//# sourceMappingURL=rotateRondel.js.map