mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Fixed not working opponent or planeswalker filter (count all permanents instead planeswalkers);
This commit is contained in:
parent
cf9ac754f0
commit
4e12b06bc7
3 changed files with 77 additions and 21 deletions
|
|
@ -29,6 +29,7 @@ package mage.filter;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.SubType;
|
||||
|
|
@ -66,6 +67,13 @@ public class FilterPermanent extends FilterObject<Permanent> implements FilterIn
|
|||
this.add(new SubtypePredicate(subtype));
|
||||
}
|
||||
|
||||
public FilterPermanent(Set<SubType> subtypesList, String name) {
|
||||
super(name);
|
||||
for (SubType subtype: subtypesList) {
|
||||
this.add(new SubtypePredicate(subtype));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkObjectClass(Object object) {
|
||||
return object instanceof Permanent;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
package mage.filter.common;
|
||||
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterOpponent;
|
||||
import mage.filter.FilterPermanent;
|
||||
|
||||
|
|
@ -19,7 +20,7 @@ public class FilterOpponentOrPlaneswalker extends FilterPermanentOrPlayer {
|
|||
}
|
||||
|
||||
public FilterOpponentOrPlaneswalker(String name) {
|
||||
super(name, new FilterPermanent(), new FilterOpponent());
|
||||
super(name, new FilterPermanent(SubType.getPlaneswalkerTypes(true), "planeswalker"), new FilterOpponent());
|
||||
}
|
||||
|
||||
public FilterOpponentOrPlaneswalker(final FilterOpponentOrPlaneswalker filter) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue