mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Merge pull request #5047 from NoahGleason/mourners-shield
Implement Mourner's Shield
This commit is contained in:
commit
c4d9bfe554
3 changed files with 210 additions and 0 deletions
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue