forked from External/mage
Refactor: added copyFrom info for all objects (original card used for copy, copy of copy and etc);
This commit is contained in:
parent
28ac95cb10
commit
59bda7f1d5
25 changed files with 269 additions and 220 deletions
|
|
@ -41,6 +41,8 @@ public class Plane implements CommandObject {
|
|||
private UUID id;
|
||||
private UUID controllerId;
|
||||
private MageObject sourceObject;
|
||||
private boolean copy;
|
||||
private MageObject copyFrom; // copied card INFO (used to call original adjusters)
|
||||
private FrameStyle frameStyle;
|
||||
private Abilities<Ability> abilites = new AbilitiesImpl<>();
|
||||
private String expansionSetCodeForImage = "";
|
||||
|
|
@ -56,6 +58,8 @@ public class Plane implements CommandObject {
|
|||
this.frameStyle = plane.frameStyle;
|
||||
this.controllerId = plane.controllerId;
|
||||
this.sourceObject = plane.sourceObject;
|
||||
this.copy = plane.copy;
|
||||
this.copyFrom = (plane.copyFrom != null ? plane.copyFrom.copy() : null);
|
||||
this.abilites = plane.abilites.copy();
|
||||
this.expansionSetCodeForImage = plane.expansionSetCodeForImage;
|
||||
}
|
||||
|
|
@ -105,6 +109,22 @@ public class Plane implements CommandObject {
|
|||
this.abilites.setControllerId(controllerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCopy(boolean isCopy, MageObject copyFrom) {
|
||||
this.copy = isCopy;
|
||||
this.copyFrom = (copyFrom != null ? copyFrom.copy() : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCopy() {
|
||||
return this.copy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MageObject getCopyFrom() {
|
||||
return this.copyFrom;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
|
|
@ -208,15 +228,6 @@ public class Plane implements CommandObject {
|
|||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCopy(boolean isCopy) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCopy() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plane copy() {
|
||||
return new Plane(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue