mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
CardTraitBase: move isSecondary from Trigger and ReplacementEffect to CardTraitBase to use it for all of them.
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user