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.

17 lines (15 loc) 389 B
import { StateReducer } from '../../types' export const checkFinalPhase = (next: number): StateReducer => (state) => { if (state === undefined) return undefined const buildings = state.config.length === 'long' ? 3 : 1 if (state.buildings.length > buildings) return state return { ...state, frame: { ...state.frame, next, }, } }