import { SupplyCard } from "../dominion/supply-card" ; import { SupplyDivision } from "./supply-division" ; export abstract class SupplyRequirement { isSatisfied ( divisions ) { for ( let division of divisions ) { if ( this . getSatisfyingCards ( division . lockedAndSelectedCards ) . length ) { return true ; } } return false ; } getSatisfyingCardsFromDivisions ( divisions ) { let satisfyingCards = [ ] ; for ( let division of divisions ) { satisfyingCards = satisfyingCards . concat ( this . getSatisfyingCards ( division . availableCards ) ) ; } return satisfyingCards ; } protected abstract getSatisfyingCards ( cards ) ; }