hathora-et-labora-game
Version:
Game logic reducer for Uwe Rosenberg's Ora et Labora
47 lines • 1.25 kB
JavaScript
import { BuildingEnum, LandEnum } from '../../types';
import { makeLandscape } from '../landscape';
import { clergyForColor } from '../player';
export const addNeutralPlayer = (state) => {
if (state === undefined)
return state;
const { color } = state.players[1];
const clergy = clergyForColor(state.config)(color);
const [row0, row1] = makeLandscape(color);
const landscape = [
[
[],
[],
[],
[],
[],
[],
row0[6],
[],
[],
],
[
[], // basically its just an empty landscape, but use the right colors
[],
[],
[],
row1[4],
[],
row1[6],
[],
[],
],
];
return {
...state,
players: [
state.players[0],
{
...state.players[1],
color,
clergy,
landscape,
},
],
};
};
//# sourceMappingURL=addNeutralPlayer.js.map