@Override public Rarity getRarity() { return card.getRarity(); }
@Override public boolean apply(Card input, Game game) { return input.getRarity().equals(rarity); }
for (ObjectColor color : colors) { colorWeight.put(color, colorWeight.get(color) + cardColorWeight); if (card.getRarity() != Rarity.COMMON) { uncommonWeight.put(color, uncommonWeight.get(color) + cardColorWeight);
/** * Checks if the given card is legal in any of the given rarities * * @param card - the card to check * @return Whether the card was printed at any of the given rarities. */ protected boolean legalRarity(Card card) { // check if card is legal if taken from other set boolean legal = false; List<CardInfo> cardInfos = CardRepository.instance.findCards(card.getName()); for (CardInfo cardInfo : cardInfos) { if (rarities.contains(cardInfo.getRarity())) { legal = true; break; } } if (!legal && !invalid.containsKey(card.getName())) { invalid.put(card.getName(), "Invalid rarity: " + card.getRarity()); } return legal; }
this.cardNumber = "0"; } else { this.rarity = card.getRarity();
/** * Return rating of the card. * * @param card Card to rate. * @return Rating number from [1:100]. */ public static int getCardRating(Card card) { readRatingSetList(); String exp = card.getExpansionSetCode().toLowerCase(); readRatings(exp); if (ratings != null && ratings.containsKey(card.getName())) { return ratings.get(card.getName()); } Rarity r = card.getRarity(); if (Rarity.COMMON == r) { return DEFAULT_NOT_RATED_CARD_RATING; } else if (Rarity.UNCOMMON == r) { return DEFAULT_NOT_RATED_UNCOMMON_RATING; } else if (Rarity.RARE == r) { return DEFAULT_NOT_RATED_RARE_RATING; } else if (Rarity.MYTHIC == r) { return DEFAULT_NOT_RATED_MYTHIC_RATING; } return DEFAULT_NOT_RATED_CARD_RATING; }
public static int getCardDefinitionScore(final Game game, final Card card) { int value = 3; //TODO: add new rating system card value if (card.isLand()) { int score = (int) ((value / 2.0f) * 50); //TODO: check this for "any color" lands //TODO: check this for dual and filter lands /*for (Mana mana : card.getMana()) { score += 50; }*/ score += card.getMana().size() * 50; return score; } final int score = value * 100 - card.getManaCost().convertedManaCost() * 20; if (card.getCardType().contains(CardType.CREATURE)) { return score + (card.getPower().getValue() + card.getToughness().getValue()) * 10; } else { return score + (/*card.getRemoval()*50*/+card.getRarity().getRating() * 30); } }
this.toughness = card.getToughness().toString(); this.convertedManaCost = card.getConvertedManaCost(); this.rarity = card.getRarity(); this.splitCard = card.isSplitCard(); this.splitCardFuse = card.getSpellAbility() != null && card.getSpellAbility().getSpellAbilityType() == SpellAbilityType.SPLIT_FUSED;
supertype.addAll(card.getSuperType()); this.expansionSetCode = card.getExpansionSetCode(); this.rarity = card.getRarity(); this.cardNumber = card.getCardNumber(); this.usesVariousArt = card.getUsesVariousArt();
this.type = ((PermanentToken) card).getToken().getTokenType(); } else { this.rarity = card.getRarity(); this.isToken = false;