override change method in triggers with specialize addTrigger methods
parent
0d0f0bf98c
commit
ed4d60cb34
|
@ -630,18 +630,22 @@ public class MagicCardDefinition {
|
|||
|
||||
public void addTrigger(final MagicWhenSpellIsCastTrigger trigger) {
|
||||
spellIsCastTriggers.add(trigger);
|
||||
numTriggers++;
|
||||
}
|
||||
|
||||
public void addTrigger(final MagicWhenComesIntoPlayTrigger trigger) {
|
||||
comeIntoPlayTriggers.add(trigger);
|
||||
numTriggers++;
|
||||
}
|
||||
|
||||
public void addTrigger(final MagicWhenPutIntoGraveyardTrigger trigger) {
|
||||
putIntoGraveyardTriggers.add(trigger);
|
||||
numTriggers++;
|
||||
}
|
||||
|
||||
public void addTrigger(final MagicWhenDrawnTrigger trigger) {
|
||||
drawnTriggers.add(trigger);
|
||||
numTriggers++;
|
||||
}
|
||||
|
||||
public void addTrigger(final MagicTrigger<?> trigger) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package magic.model.trigger;
|
||||
|
||||
import magic.model.MagicPlayer;
|
||||
import magic.model.MagicCardDefinition;
|
||||
|
||||
public abstract class MagicWhenComesIntoPlayTrigger extends MagicTrigger<MagicPlayer> {
|
||||
public MagicWhenComesIntoPlayTrigger(final int priority) {
|
||||
|
@ -12,4 +13,9 @@ public abstract class MagicWhenComesIntoPlayTrigger extends MagicTrigger<MagicPl
|
|||
public MagicTriggerType getType() {
|
||||
return MagicTriggerType.WhenComesIntoPlay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void change(final MagicCardDefinition cdef) {
|
||||
cdef.addTrigger(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package magic.model.trigger;
|
||||
|
||||
import magic.model.MagicCard;
|
||||
import magic.model.MagicCardDefinition;
|
||||
|
||||
public abstract class MagicWhenDrawnTrigger extends MagicTrigger<MagicCard> {
|
||||
public MagicWhenDrawnTrigger(final int priority) {
|
||||
|
@ -12,4 +13,9 @@ public abstract class MagicWhenDrawnTrigger extends MagicTrigger<MagicCard> {
|
|||
public MagicTriggerType getType() {
|
||||
return MagicTriggerType.WhenDrawn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void change(final MagicCardDefinition cdef) {
|
||||
cdef.addTrigger(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package magic.model.trigger;
|
||||
|
||||
import magic.model.MagicCardDefinition;
|
||||
|
||||
public abstract class MagicWhenPutIntoGraveyardTrigger extends MagicTrigger<MagicGraveyardTriggerData> {
|
||||
public MagicWhenPutIntoGraveyardTrigger(final int priority) {
|
||||
|
@ -11,4 +12,9 @@ public abstract class MagicWhenPutIntoGraveyardTrigger extends MagicTrigger<Magi
|
|||
public MagicTriggerType getType() {
|
||||
return MagicTriggerType.WhenPutIntoGraveyard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void change(final MagicCardDefinition cdef) {
|
||||
cdef.addTrigger(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package magic.model.trigger;
|
||||
|
||||
import magic.model.MagicCardDefinition;
|
||||
import magic.model.stack.MagicCardOnStack;
|
||||
|
||||
public abstract class MagicWhenSpellIsCastTrigger extends MagicTrigger<MagicCardOnStack> {
|
||||
|
@ -12,4 +13,9 @@ public abstract class MagicWhenSpellIsCastTrigger extends MagicTrigger<MagicCard
|
|||
public MagicTriggerType getType() {
|
||||
return MagicTriggerType.WhenSpellIsCast;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void change(final MagicCardDefinition cdef) {
|
||||
cdef.addTrigger(this);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue