mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Changed argument types of FilterCreatureOrPlayer to MageItem instead of Object.
Both Permanent and Player inherit from MageItem, so it's more specific.
This commit is contained in:
parent
6dfa2d1d94
commit
41d41444d1
1 changed files with 4 additions and 3 deletions
|
@ -34,6 +34,7 @@ import mage.filter.FilterPlayer;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
import mage.MageItem;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ import java.util.UUID;
|
||||||
*
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
public class FilterCreatureOrPlayer extends FilterImpl<Object> implements FilterInPlay<Object> {
|
public class FilterCreatureOrPlayer extends FilterImpl<MageItem> implements FilterInPlay<MageItem> {
|
||||||
|
|
||||||
protected FilterCreaturePermanent creatureFilter;
|
protected FilterCreaturePermanent creatureFilter;
|
||||||
protected FilterPlayer playerFilter;
|
protected FilterPlayer playerFilter;
|
||||||
|
@ -63,7 +64,7 @@ public class FilterCreatureOrPlayer extends FilterImpl<Object> implements Filter
|
||||||
}
|
}
|
||||||
|
|
||||||
@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);
|
||||||
}
|
}
|
||||||
|
@ -74,7 +75,7 @@ public class FilterCreatureOrPlayer extends FilterImpl<Object> implements Filter
|
||||||
}
|
}
|
||||||
|
|
||||||
@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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue