import { CardType } from "../dominion/card-type" ; import { Cards } from "../utils/cards" ; import { SupplyCard } from "../dominion/supply-card" ; import { SupplyDivision } from "./supply-division" ; import { SupplyRequirement } from "./supply-requirement" ; export class TypeSupplyRequirement extends SupplyRequirement { constructor ( readonly type , readonly requireNewCard ) { super ( ) ; } isSatisfied ( divisions ) { return this . requireNewCard ? false : super . isSatisfied ( divisions ) ; } protected getSatisfyingCards ( cards ) { return cards . filter ( Cards . filterByRequiredType ( this . type ) ) ; } toString ( ) { return `TypeSupplyRequirement(type=${ this . type },requireNewCard=${ this . requireNewCard })` ; } }