mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Added AnotherEnchantedPredicate object.
This commit is contained in:
parent
e19172fb91
commit
869039a4cf
1 changed files with 30 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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.permanent;
|
||||
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* Filters out the id of the enchanted object, if the source is an enchantment
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class AnotherEnchantedPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Permanent>> {
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
||||
Permanent enchantment = game.getPermanentOrLKIBattlefield(input.getSourceId());
|
||||
return enchantment != null && !input.getObject().getId().equals(enchantment.getAttachedTo());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Another enchanted";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue