CardTraitBase: move isSecondary from Trigger and ReplacementEffect to CardTraitBase to use it for all of them.

This commit is contained in:
Hanmac
2016-08-03 08:44:56 +00:00
parent 47e2a6d897
commit ab37dd35c0
3 changed files with 16 additions and 25 deletions

View File

@@ -126,6 +126,22 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView {
this.hostCard = c; this.hostCard = c;
} }
/**
* <p>
* isSecondary.
* </p>
*
* @return a boolean.
*/
public final boolean isSecondary() {
if (this.mapParams.containsKey("Secondary")) {
if (this.mapParams.get("Secondary").equals("True")) {
return true;
}
}
return false;
}
/** /**
* <p> * <p>
* matchesValid. * matchesValid.

View File

@@ -64,15 +64,6 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
this.setHostCard(host); this.setHostCard(host);
} }
/**
* Checks if is secondary.
*
* @return true, if is secondary
*/
public final boolean isSecondary() {
return this.getMapParams().containsKey("Secondary");
}
/** /**
* Sets the checks for run. * Sets the checks for run.
* *

View File

@@ -293,22 +293,6 @@ public abstract class Trigger extends TriggerReplacementBase {
return true; return true;
} }
/**
* <p>
* isSecondary.
* </p>
*
* @return a boolean.
*/
public final boolean isSecondary() {
if (this.mapParams.containsKey("Secondary")) {
if (this.mapParams.get("Secondary").equals("True")) {
return true;
}
}
return false;
}
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public final boolean equals(final Object o) { public final boolean equals(final Object o) {