mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Changed Object to MageItem in FilterPermanentOrPlayer and FilterPermanentOrPlayerWithCounter since that is the more specific class that both Permanent and Player inherit from.
This commit is contained in:
parent
bdafb4a003
commit
7f22f527fe
2 changed files with 7 additions and 5 deletions
|
@ -37,11 +37,12 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.MageItem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author nantuko
|
* @author nantuko
|
||||||
*/
|
*/
|
||||||
public class FilterPermanentOrPlayer extends FilterImpl<Object> implements FilterInPlay<Object> {
|
public class FilterPermanentOrPlayer extends FilterImpl<MageItem> implements FilterInPlay<MageItem> {
|
||||||
|
|
||||||
protected FilterPermanent permanentFilter;
|
protected FilterPermanent permanentFilter;
|
||||||
protected FilterPlayer playerFilter;
|
protected FilterPlayer playerFilter;
|
||||||
|
@ -63,7 +64,7 @@ public class FilterPermanentOrPlayer extends FilterImpl<Object> implements Filte
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean match(Object o, Game game) {
|
public boolean match(MageItem o, Game game) {
|
||||||
if (o instanceof Player) {
|
if (o instanceof Player) {
|
||||||
return playerFilter.match((Player) o, game);
|
return playerFilter.match((Player) o, game);
|
||||||
} else if (o instanceof Permanent) {
|
} else if (o instanceof Permanent) {
|
||||||
|
@ -73,7 +74,7 @@ public class FilterPermanentOrPlayer extends FilterImpl<Object> implements Filte
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean match(Object o, UUID sourceId, UUID playerId, Game game) {
|
public boolean match(MageItem o, UUID sourceId, UUID playerId, Game game) {
|
||||||
if (o instanceof Player) {
|
if (o instanceof Player) {
|
||||||
return playerFilter.match((Player) o, sourceId, playerId, game);
|
return playerFilter.match((Player) o, sourceId, playerId, game);
|
||||||
} else if (o instanceof Permanent) {
|
} else if (o instanceof Permanent) {
|
||||||
|
|
|
@ -33,6 +33,7 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.MageItem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author nantuko
|
* @author nantuko
|
||||||
|
@ -52,7 +53,7 @@ public class FilterPermanentOrPlayerWithCounter extends FilterPermanentOrPlayer
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean match(Object o, Game game) {
|
public boolean match(MageItem o, Game game) {
|
||||||
if (o instanceof Player) {
|
if (o instanceof Player) {
|
||||||
if (((Player)o).getCounters().size() == 0) {
|
if (((Player)o).getCounters().size() == 0) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -66,7 +67,7 @@ public class FilterPermanentOrPlayerWithCounter extends FilterPermanentOrPlayer
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean match(Object o, UUID sourceId, UUID playerId, Game game) {
|
public boolean match(MageItem o, UUID sourceId, UUID playerId, Game game) {
|
||||||
if (o instanceof Player) {
|
if (o instanceof Player) {
|
||||||
return playerFilter.match((Player) o, sourceId, playerId, game);
|
return playerFilter.match((Player) o, sourceId, playerId, game);
|
||||||
} else if (o instanceof Permanent) {
|
} else if (o instanceof Permanent) {
|
||||||
|
|
Loading…
Reference in a new issue