Initial commit from your app

This commit is contained in:
Reynier Matthieu
2025-02-27 16:56:23 +01:00
parent f5e02f6b78
commit 3933415b2d
5 changed files with 1220 additions and 1051 deletions

View File

@@ -67,7 +67,10 @@ export function validateDeck(deck: Deck): DeckValidation {
}
cardCounts.forEach((count, cardName) => {
if (count > rules.maxCopies) {
const card = deck.cards.find(c => c.card.id === cardName)?.card;
const isBasicLand = card?.name === 'Plains' || card?.name === 'Island' || card?.name === 'Swamp' || card?.name === 'Mountain' || card?.name === 'Forest';
if (!isBasicLand && count > rules.maxCopies) {
errors.push(`${cardName} has too many copies (max ${rules.maxCopies})`);
}
});