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)
| 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); |
no test coverage detected