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

Method isModern

forge-core/src/main/java/forge/deck/CardPool.java:295–309  ·  view source on GitHub ↗

Determines whether (the majority of the) cards in the Pool are modern framed (that is, cards are from Modern Card Edition). @return True if the majority of cards in Pool are from Modern Edition, false otherwise. If the count of Modern and PreModern cards is tied, the return value is determined by t

()

Source from the content-addressed store, hash-verified

293 * by the preferred Card Art Preference settings, namely True if Latest Art, False otherwise.
294 */
295 public boolean isModern() {
296 int modernEditionsCount = 0;
297 int preModernEditionsCount = 0;
298 Map<CardEdition, Integer> editionStats = this.getCardEditionStatistics(false);
299 for (Map.Entry<CardEdition, Integer> entry: editionStats.entrySet()) {
300 CardEdition edition = entry.getKey();
301 if (edition.isModern())
302 modernEditionsCount += entry.getValue();
303 else
304 preModernEditionsCount += entry.getValue();
305 }
306 if (modernEditionsCount == preModernEditionsCount)
307 return StaticData.instance().cardArtPreferenceIsLatest();
308 return modernEditionsCount > preModernEditionsCount;
309 }
310
311 /**
312 * Determines the Pivot Edition for cards in the Pool.

Calls 6

isModernMethod · 0.95
instanceMethod · 0.95
getKeyMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected