Implement Mourner's Shield

This commit is contained in:
Noah Gleason 2018-06-20 22:56:04 -04:00
parent 6b149b44c7
commit 6a2eda0146
No known key found for this signature in database
GPG key ID: EC030EC6B0650A40
3 changed files with 210 additions and 0 deletions

View file

@ -0,0 +1,39 @@
/*
* 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.filter.predicate.mageobject;
import mage.MageObject;
import mage.ObjectColor;
import mage.filter.predicate.ObjectSourcePlayer;
import mage.filter.predicate.ObjectSourcePlayerPredicate;
import mage.filter.predicate.Predicate;
import mage.game.Game;
/**
*
* @author noahg
*/
public class SharesColorPredicate implements Predicate<MageObject> {
private final ObjectColor color;
public SharesColorPredicate(ObjectColor color) {
this.color = color;
}
@Override
public boolean apply(MageObject input, Game game) {
return color != null && input.getColor(game).shares(color);
}
@Override
public String toString() {
return "shares a color";
}
}