import { PieceModel } from "@creature-chess/models" ; import { BoardSelectors , BoardState } from "@shoki/board" ; export const isATeamDefeated = ( board ) => { const pieceOwnerIds = BoardSelectors . getAllPieces ( board ) . map ( p => p . ownerId ) ; return ( new Set ( pieceOwnerIds ) . size === 1 ) ; } ;