Merge pull request #5047 from NoahGleason/mourners-shield

Implement Mourner's Shield
This commit is contained in:
theelk801 2018-06-23 13:38:06 -04:00 committed by GitHub
commit c4d9bfe554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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";
}
}