forked from External/mage
Added common interface to conditional effects (#9208)
This commit is contained in:
parent
5c54eccffd
commit
78f3547644
11 changed files with 62 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ package mage.abilities.effects;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.constants.EffectType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
|
|
@ -67,4 +68,18 @@ public interface Effect extends Serializable, Copyable<Effect> {
|
|||
Effect concatBy(String concatPrefix);
|
||||
|
||||
String getConcatPrefix();
|
||||
|
||||
/**
|
||||
* Used to check if this is a conditional version without needed any Java reflection hacks or chained instanceof checks.
|
||||
* Only conditions on the activation of the ability are checked, and not on how the effects can be used.
|
||||
* E.g. For a conditional mana ability this will only return the condition under which it can be activated,
|
||||
* and NOT the conditions on the mane produced.
|
||||
*
|
||||
* Assumed that if the returned condition is null then this is not a conditional version, or that it does not matter.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public default Condition getCondition() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue