MCPcopy Create free account
hub / github.com/Card-Forge/forge / getValidRarities

Method getValidRarities

forge-game/src/main/java/forge/game/Game.java:1145–1158  ·  view source on GitHub ↗
(final Iterable<Card> cards)

Source from the content-addressed store, hash-verified

1143 }
1144
1145 private static Set<CardRarity> getValidRarities(final Iterable<Card> cards) {
1146 final Set<CardRarity> rarities = new HashSet<>();
1147 for (final Card card : cards) {
1148 if (card.getRarity() == CardRarity.Rare || card.getRarity() == CardRarity.MythicRare) {
1149 //Since both rare and mythic rare are considered the same, adding both rarities
1150 //massively increases the odds chances of the game picking rare cards to ante.
1151 //This is a little unfair, so we add just one of the two.
1152 rarities.add(CardRarity.Rare);
1153 } else {
1154 rarities.add(card.getRarity());
1155 }
1156 }
1157 return rarities;
1158 }
1159
1160 public void clearCaches() {
1161 lastStateBattlefield.clear();

Callers 1

chooseCardsForAnteMethod · 0.95

Calls 2

getRarityMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected