use of mage.view.PermanentView in project mage by magefree.
the class CardPanelRenderModeMTGO method cardViewEquals.
private static boolean cardViewEquals(CardView a, CardView b) {
if (a == b) {
return true;
}
if (a.getClass() != b.getClass()) {
return false;
}
if (!a.getDisplayName().equals(b.getDisplayName())) {
return false;
}
if (!a.getPower().equals(b.getPower())) {
return false;
}
if (!a.getToughness().equals(b.getToughness())) {
return false;
}
if (!a.getLoyalty().equals(b.getLoyalty())) {
return false;
}
if (0 != a.getColor().compareTo(b.getColor())) {
return false;
}
if (!a.getCardTypes().equals(b.getCardTypes())) {
return false;
}
if (!a.getSubTypes().equals(b.getSubTypes())) {
return false;
}
if (!a.getSuperTypes().equals(b.getSuperTypes())) {
return false;
}
if (!a.getManaCostStr().equals(b.getManaCostStr())) {
return false;
}
if (!a.getRules().equals(b.getRules())) {
return false;
}
if (a.getRarity() == null || b.getRarity() == null) {
return false;
}
if (a.getRarity() != b.getRarity()) {
return false;
}
if (a.getCardNumber() != null && !a.getCardNumber().equals(b.getCardNumber())) {
return false;
}
// Expansion set code, with null checking:
// TODO: The null checks should not be necessary, but thanks to Issue #2260
// some tokens / commandobjects will be missing expansion set codes.
String expA = a.getExpansionSetCode();
if (expA == null) {
expA = "";
}
String expB = b.getExpansionSetCode();
if (expB == null) {
expB = "";
}
if (!expA.equals(expB)) {
return false;
}
if (a.getFrameStyle() != b.getFrameStyle()) {
return false;
}
if (a.getCounters() == null) {
if (b.getCounters() != null) {
return false;
}
} else if (!a.getCounters().equals(b.getCounters())) {
return false;
}
if (a.isFaceDown() != b.isFaceDown()) {
return false;
}
if ((a instanceof PermanentView)) {
PermanentView aa = (PermanentView) a;
PermanentView bb = (PermanentView) b;
if (aa.hasSummoningSickness() != bb.hasSummoningSickness()) {
// are the same for a and b
return false;
}
return aa.getDamage() == bb.getDamage();
}
return true;
}
Aggregations