diff --git a/src/main/java/forge/card/CardColor.java b/src/main/java/forge/card/CardColor.java index e4df549c386..6e8a9d920b6 100644 --- a/src/main/java/forge/card/CardColor.java +++ b/src/main/java/forge/card/CardColor.java @@ -300,4 +300,24 @@ public final class CardColor implements Comparable { public static void setNullColor(final CardColor nullColor0) { CardColor.nullColor = nullColor0; } + + public boolean sharesColorWith(CardColor ccOther) { + + if (this.isWhite() && ccOther.isWhite()) + return true; + + if (this.isBlue() && ccOther.isBlue()) + return true; + + if (this.isBlack() && ccOther.isBlack()) + return true; + + if (this.isRed() && ccOther.isRed()) + return true; + + if (this.isGreen() && ccOther.isGreen()) + return true; + + return false; + } } diff --git a/src/main/java/forge/card/CardType.java b/src/main/java/forge/card/CardType.java index c1efddbda9b..924395efef7 100644 --- a/src/main/java/forge/card/CardType.java +++ b/src/main/java/forge/card/CardType.java @@ -296,4 +296,16 @@ public final class CardType implements Comparable { return this.toString().compareTo(o.toString()); } + public List getSubTypes() { + return this.subType; + } + + public boolean sharesSubTypeWith(CardType ctOther) { + for (String t : ctOther.getSubTypes()) { + if (this.subTypeContains(t)) + return true; + } + + return false; + } }