Refactoring subtypes to make Maskwood Nexus work (ready for review) (#7432)

* removed and renamed SubTypeList

* updated subtype test

* refactored Changeling to be an ability that actually does something

* moved isAllCreatureTypes into SubTypes class

* renamed copyTo method to copyFrom

* added removeAllCreatureTypes where usable

* replaced some subtype methods

* replaced some more subtype methods

* replaced subtype mass add/remove methods

* updated more subtype methods

* fixed some errors

* made common shared creature type predicate

* refactored another card involving subtypes

* Added usage of object attribute in subTypes's write operations;

* Refactor: use same param styles in subtype methods

* Refactor: simplified usage of copy appliers;

* Refactor: fixed code usage in CopyApplier

Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
This commit is contained in:
Evan Kranzler 2021-01-26 08:52:35 -05:00 committed by GitHub
parent 6f42b90305
commit dacf30f4b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
259 changed files with 1857 additions and 1922 deletions

View file

@ -1,14 +1,10 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.game;
import java.io.Serializable;
import mage.MageObject;
import mage.ObjectColor;
import mage.util.SubTypeList;
import mage.util.SubTypes;
import java.io.Serializable;
/**
* This class saves changed attributes of mage objects (e.g. in command zone, graveyard, exile or
@ -19,12 +15,11 @@ import mage.util.SubTypeList;
public class MageObjectAttribute implements Serializable {
protected ObjectColor color;
protected SubTypeList subtype;
protected SubTypes subtype;
public MageObjectAttribute(MageObject mageObject, Game game) {
color = mageObject.getColor(null).copy();
subtype = new SubTypeList();
subtype.addAll(mageObject.getSubtype(game));
color = mageObject.getColor().copy();
subtype = new SubTypes(mageObject.getSubtype(game));
}
public MageObjectAttribute(MageObjectAttribute mageObjectAttribute) {
@ -40,7 +35,7 @@ public class MageObjectAttribute implements Serializable {
return color;
}
public SubTypeList getSubtype() {
public SubTypes getSubtype() {
return subtype;
}