- Added the property "sharesTypeWith".

This commit is contained in:
jeffwadsworth
2011-12-05 22:23:06 +00:00
parent dc560e5efe
commit 74f17641bb

View File

@@ -6811,6 +6811,10 @@ public class Card extends GameEntity implements Comparable<Card> {
if (!this.sharesCreatureTypeWith(source)) {
return false;
}
} else if (property.startsWith("sharesTypeWith")) {
if (!this.sharesTypeWith(source)) {
return false;
}
} else if (property.startsWith("withFlashback")) {
boolean fb = false;
if (this.hasStartOfUnHiddenKeyword("Flashback")) {
@@ -7281,6 +7285,25 @@ public class Card extends GameEntity implements Comparable<Card> {
}
return false;
}
/**
* <p>
* sharesTypeWith.
* </p>
*
* @param c1
* a {@link forge.Card} object.
* @return a boolean.
*/
public final boolean sharesTypeWith(final Card c1) {
for (String type : this.getType()) {
if (c1.isType(type)) {
return true;
}
}
return false;
}
/**
* <p>