- Improve handling for SVars in PresentCompare

This commit is contained in:
Sol
2016-01-15 04:39:34 +00:00
parent cd5ee18525
commit 2bac793f58

View File

@@ -215,7 +215,6 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView {
}
}
if (params.containsKey("IsPresent")) {
final String sIsPresent = params.get("IsPresent");
String presentCompare = "GE1";
@@ -244,10 +243,10 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView {
int right = 1;
final String rightString = presentCompare.substring(2);
if (rightString.equals("X")) {
right = CardFactoryUtil.xCount(this.getHostCard(), this.getHostCard().getSVar("X"));
} else {
right = Integer.parseInt(presentCompare.substring(2));
try {
right = Integer.parseInt(rightString);
} catch (final NumberFormatException nfe) {
right = CardFactoryUtil.xCount(this.getHostCard(), this.getHostCard().getSVar(rightString));
}
final int left = list.size();
@@ -285,10 +284,10 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView {
int right = 1;
final String rightString = presentCompare.substring(2);
if (rightString.equals("X")) {
right = CardFactoryUtil.xCount(this.getHostCard(), this.getHostCard().getSVar("X"));
} else {
right = Integer.parseInt(presentCompare.substring(2));
try {
right = Integer.parseInt(rightString);
} catch (final NumberFormatException nfe) {
right = CardFactoryUtil.xCount(this.getHostCard(), this.getHostCard().getSVar(rightString));
}
final int left = list.size();