updated some methods to support collections of card subclasses

This commit is contained in:
Evan Kranzler 2021-03-02 09:41:39 -05:00
parent c552234e9c
commit 3b5147f6ee
6 changed files with 37 additions and 28 deletions

View file

@ -4097,14 +4097,14 @@ public abstract class PlayerImpl implements Player, Serializable {
}
@Override
public boolean moveCards(Set<Card> cards, Zone toZone,
public boolean moveCards(Set<? extends Card> cards, Zone toZone,
Ability source, Game game
) {
return moveCards(cards, toZone, source, game, false, false, false, null);
}
@Override
public boolean moveCards(Set<Card> cards, Zone toZone, Ability source, Game game, boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects) {
public boolean moveCards(Set<? extends Card> cards, Zone toZone, Ability source, Game game, boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects) {
if (cards.isEmpty()) {
return true;
}
@ -4248,13 +4248,13 @@ public abstract class PlayerImpl implements Player, Serializable {
}
@Override
public Set<Card> moveCardsToGraveyardWithInfo(Set<Card> allCards, Ability source, Game game, Zone fromZone) {
public Set<Card> moveCardsToGraveyardWithInfo(Set<? extends Card> allCards, Ability source, Game game, Zone fromZone) {
Set<Card> movedCards = new LinkedHashSet<>();
while (!allCards.isEmpty()) {
// identify cards from one owner
Cards cards = new CardsImpl();
UUID ownerId = null;
for (Iterator<Card> it = allCards.iterator(); it.hasNext(); ) {
for (Iterator<? extends Card> it = allCards.iterator(); it.hasNext(); ) {
Card card = it.next();
if (cards.isEmpty()) {
ownerId = card.getOwnerId();