mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
added some functions to mode implementation
This commit is contained in:
parent
1a8268889f
commit
e7af7c922a
2 changed files with 23 additions and 10 deletions
|
|
@ -1,9 +1,10 @@
|
|||
|
||||
package mage.abilities;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.target.Target;
|
||||
import mage.target.Targets;
|
||||
|
||||
/**
|
||||
|
|
@ -13,16 +14,23 @@ import mage.target.Targets;
|
|||
public class Mode implements Serializable {
|
||||
|
||||
protected UUID id;
|
||||
protected Targets targets;
|
||||
protected Effects effects;
|
||||
protected final Targets targets;
|
||||
protected final Effects effects;
|
||||
|
||||
public Mode() {
|
||||
this((Effect) null);
|
||||
}
|
||||
|
||||
public Mode(Effect effect) {
|
||||
this.id = UUID.randomUUID();
|
||||
this.targets = new Targets();
|
||||
this.effects = new Effects();
|
||||
if (effect != null) {
|
||||
this.effects.add(effect);
|
||||
}
|
||||
}
|
||||
|
||||
public Mode(Mode mode) {
|
||||
public Mode(final Mode mode) {
|
||||
this.id = mode.id;
|
||||
this.targets = mode.targets.copy();
|
||||
this.effects = mode.effects.copy();
|
||||
|
|
@ -44,7 +52,15 @@ public class Mode implements Serializable {
|
|||
return targets;
|
||||
}
|
||||
|
||||
public void addTarget(Target target) {
|
||||
targets.add(target);
|
||||
}
|
||||
|
||||
public Effects getEffects() {
|
||||
return effects;
|
||||
}
|
||||
|
||||
public void addEffect(Effect effect) {
|
||||
effects.add(effect);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue