remove deprecated discard method

This commit is contained in:
Ingmar Goudt 2019-12-30 00:22:33 +01:00
parent f68d6b80ba
commit 978309827b
13 changed files with 10 additions and 33 deletions

View file

@ -65,7 +65,7 @@ class BreakthroughEffect extends OneShotEffect {
if (player != null) {
int amountToKeep = source.getManaCostsToPay().getX();
if (amountToKeep == 0) {
player.discard(player.getHand().size(), source, game);
player.discard(player.getHand().size(), false, source, game);
}
else if (amountToKeep < player.getHand().size()) {
TargetCardInHand target = new TargetCardInHand(amountToKeep, new FilterCard());

View file

@ -56,7 +56,7 @@ class DimirCutpurseEffect extends OneShotEffect {
Player you = game.getPlayer(source.getControllerId());
Player damagedPlayer = game.getPlayer(targetPointer.getFirst(game, source));
if (damagedPlayer != null) {
damagedPlayer.discard(1, source, game);
damagedPlayer.discard(1, false,source, game);
}
if (you != null) {
you.drawCards(1, game);

View file

@ -75,7 +75,7 @@ class GruesomeDiscoveryEffect extends OneShotEffect {
targetPlayer.revealCards("Gruesome Discovery", targetPlayer.getHand(), game);
if (targetPlayer.getHand().size() <= 2) {
targetPlayer.discard(2, source, game);
targetPlayer.discard(2, false, source, game);
}
TargetCard target = new TargetCard(2, Zone.HAND, new FilterCard());

View file

@ -72,7 +72,7 @@ public final class IzzetKeyrune extends CardImpl {
Player player = game.getPlayer(source.getControllerId());
if (player != null && player.chooseUse(Outcome.DrawCard, "Do you wish to draw a card? If you do, discard a card.", source, game)) {
if (player.drawCards(1, game) > 0) {
player.discard(1, source, game);
player.discard(1, false, source, game);
}
return true;
}

View file

@ -64,7 +64,7 @@ class MurderOfCrowsEffect extends OneShotEffect {
Player player = game.getPlayer(source.getControllerId());
if (player != null && player.chooseUse(Outcome.DrawCard, "Do you wish to draw a card? If you do, discard a card.", source, game)) {
if (player.drawCards(1, game) > 0) {
player.discard(1, source, game);
player.discard(1, false, source, game);
}
return true;
}

View file

@ -64,7 +64,7 @@ class WhisperingSpecterEffect extends OneShotEffect {
if (player != null) {
int value = player.getCounters().getCount(CounterType.POISON);
if (value > 0) {
player.discard(value, source, game);
player.discard(value, false, source, game);
return true;
}
}

View file

@ -66,7 +66,7 @@ class WrenchMindEffect extends OneShotEffect {
if (card != null) {
targetPlayer.discard(card, source, game);
if (!card.isArtifact() && !targetPlayer.getHand().isEmpty()) {
targetPlayer.discard(1, source, game);
targetPlayer.discard(1, false, source, game);
}
return true;
}

View file

@ -2304,11 +2304,6 @@ public class TestPlayer implements Player {
return computerPlayer.removeFromLibrary(card, game);
}
@Override
public void discard(int amount, Ability source, Game game) {
computerPlayer.discard(amount, source, game);
}
@Override
public Card discardOne(boolean random, Ability source, Game game) {
return computerPlayer.discardOne(random, source, game);

View file

@ -657,11 +657,6 @@ public class PlayerStub implements Player {
return 1;
}
@Override
public void discard(int amount, Ability source, Game game) {
}
@Override
public Card discardOne(boolean random, Ability source, Game game) {
return null;

View file

@ -50,7 +50,7 @@ public class DrawDiscardTargetEffect extends OneShotEffect {
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
if (player != null) {
player.drawCards(cardsToDraw, game);
player.discard(cardsToDiscard, source, game);
player.discard(cardsToDiscard, false, source, game);
return true;
}
return false;

View file

@ -44,7 +44,7 @@ public class DiscardHandTargetEffect extends OneShotEffect {
for (UUID playerId: getTargetPointer().getTargets(game, source)) {
Player player = game.getPlayer(playerId);
if (player != null) {
player.discard(player.getHand().size(), source, game);
player.discard(player.getHand().size(), false, source, game);
}
}
return true;

View file

@ -408,9 +408,6 @@ public interface Player extends MageItem, Copyable<Player> {
PlanarDieRoll rollPlanarDie(Game game, ArrayList<UUID> appliedEffects, int numberChaosSides, int numberPlanarSides);
@Deprecated
void discard(int amount, Ability source, Game game);
Card discardOne(boolean random, Ability source, Game game);
Cards discard(int amount, boolean random, Ability source, Game game);

View file

@ -693,7 +693,7 @@ public abstract class PlayerImpl implements Player, Serializable {
+ (this.maxHandSize == 1
? " hand card" : " hand cards"));
}
discard(hand.size() - this.maxHandSize, null, game);
discard(hand.size() - this.maxHandSize, false,null, game);
}
}
@ -731,16 +731,6 @@ public abstract class PlayerImpl implements Player, Serializable {
return true;
}
/**
* @param amount
* @param source
* @param game
*/
@Override
public void discard(int amount, Ability source, Game game) {
discard(amount, false, source, game);
}
@Override
public Card discardOne(boolean random, Ability source, Game game) {
Cards cards = discard(1, random, source, game);