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

Method getRules

forge-core/src/main/java/forge/card/CardDb.java:623–633  ·  view source on GitHub ↗

Retrieves a CardRules matching the provided name. @param allowAltNames If false, the name must be the exact name of the card in its default state. If true, flavor names and alternate face names can be used, though an exact match will be preferred. @see #getAllCards(String) @see

(String cardName, boolean allowAltNames)

Source from the content-addressed store, hash-verified

621 * @see #getAllCardsNoAlt(String)
622 */
623 public CardRules getRules(String cardName, boolean allowAltNames) {
624 cardName = getNormalizedName(cardName);
625 CardRules result = rulesByPrimaryName.get(cardName);
626 if (result != null)
627 return result;
628 if (allowAltNames) {
629 result = rulesByAltName.get(cardName);
630 return result;
631 }
632 return null;
633 }
634
635 public CardRules getRulesOrElseUnsupported(String cardName) {
636 CardRules rules = getRules(cardName, false);

Callers 4

getAllCardsNoAltMethod · 0.95
getUniqueByNameMethod · 0.95
getUniqueByNameNoAltMethod · 0.95

Calls 2

getNormalizedNameMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected