forked from External/mage
* Earnest Fellowship - Fix protection working wrong for multicolored creatures
This commit is contained in:
parent
945284946a
commit
59c80771e9
2 changed files with 30 additions and 20 deletions
|
|
@ -29,6 +29,8 @@
|
|||
package mage;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mage.util.Copyable;
|
||||
|
||||
public class ObjectColor implements Serializable, Copyable<ObjectColor>, Comparable<ObjectColor> {
|
||||
|
|
@ -97,6 +99,26 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
return count;
|
||||
}
|
||||
|
||||
public List<ObjectColor> getColors() {
|
||||
List<ObjectColor> colors = new ArrayList<>();
|
||||
if (this.isWhite()) {
|
||||
colors.add(ObjectColor.WHITE);
|
||||
}
|
||||
if (this.isBlue()) {
|
||||
colors.add(ObjectColor.BLUE);
|
||||
}
|
||||
if (this.isBlack()) {
|
||||
colors.add(ObjectColor.BLACK);
|
||||
}
|
||||
if (this.isRed()) {
|
||||
colors.add(ObjectColor.RED);
|
||||
}
|
||||
if (this.isGreen()) {
|
||||
colors.add(ObjectColor.GREEN);
|
||||
}
|
||||
return colors;
|
||||
}
|
||||
|
||||
public void setColor(ObjectColor color) {
|
||||
this.setBlack(color.isBlack());
|
||||
this.setBlue(color.isBlue());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue