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

Method sharesNameWith

forge-game/src/main/java/forge/game/card/Card.java:5860–5881  ·  view source on GitHub ↗
(final Card c1)

Source from the content-addressed store, hash-verified

5858 }
5859
5860 public final boolean sharesNameWith(final Card c1) {
5861 // in a corner case where c1 is null, there is no name to share with.
5862 if (c1 == null) {
5863 return false;
5864 }
5865
5866 // Special Logic for SpyKit
5867 if (c1.hasNonLegendaryCreatureNames()) {
5868 if (hasNonLegendaryCreatureNames()) {
5869 // with both does have this, then they share any name
5870 return true;
5871 } else if (getName().isEmpty()) {
5872 // if this does not have a name, then there is no name to share
5873 return false;
5874 } else if (StaticData.instance().getCommonCards().isNonLegendaryCreatureName(getName())) {
5875 // check if this card has a name from a face
5876 // in general token creatures does not have this
5877 return true;
5878 }
5879 }
5880 return sharesNameWith(c1.getName());
5881 }
5882
5883 public final boolean sharesNameWith(final String name) {
5884 // the name is null or empty

Callers 6

canTargetMethod · 0.95
resolveMethod · 0.95
cardHasPropertyMethod · 0.45
onCardSelectedMethod · 0.45
checkCurseEffectsMethod · 0.45

Calls 13

getNameMethod · 0.95
instanceMethod · 0.95
hasNameOverwriteMethod · 0.95
isInPlayMethod · 0.95
getUnlockedRoomNamesMethod · 0.95
hasStateMethod · 0.95
getStateMethod · 0.95
getCommonCardsMethod · 0.80
isEmptyMethod · 0.65
getNameMethod · 0.65

Tested by

no test coverage detected