forked from External/mage
program towards Interface rather than implementations
This commit is contained in:
parent
b04c436801
commit
ae7919cd07
100 changed files with 218 additions and 209 deletions
|
|
@ -705,7 +705,7 @@ public class ContinuousEffects implements Serializable {
|
|||
Cards cardsToReveal = new CardsImpl();
|
||||
do {
|
||||
FilterCard filter = new FilterCard("a card to splice");
|
||||
ArrayList<Predicate<MageObject>> idPredicates = new ArrayList<>();
|
||||
List<Predicate<MageObject>> idPredicates = new ArrayList<>();
|
||||
for (Ability ability : spliceAbilities) {
|
||||
idPredicates.add(new CardIdPredicate((ability.getSourceId())));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
private boolean tapped;
|
||||
private boolean attacking;
|
||||
private UUID lastAddedTokenId;
|
||||
private ArrayList<UUID> lastAddedTokenIds = new ArrayList<>();
|
||||
private List<UUID> lastAddedTokenIds = new ArrayList<>();
|
||||
|
||||
public CreateTokenEffect(Token token) {
|
||||
this(token, StaticValue.get(1));
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
@ -32,7 +33,7 @@ public class ExileGraveyardAllTargetPlayerEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (targetPlayer != null) {
|
||||
ArrayList<UUID> graveyard = new ArrayList<>(targetPlayer.getGraveyard());
|
||||
List<UUID> graveyard = new ArrayList<>(targetPlayer.getGraveyard());
|
||||
for (UUID cardId : graveyard) {
|
||||
game.getCard(cardId).moveToZone(Zone.EXILED, cardId, game, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,10 +12,7 @@ import mage.filter.FilterPermanent;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
|
|
@ -101,7 +98,7 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
}
|
||||
// still as long as the prev. permanent is known to the LKI (e.g. Mikaeus, the Unhallowed) so gained dies triggered ability will trigger
|
||||
HashMap<UUID, MageObject> LKIBattlefield = game.getLKI().get(Zone.BATTLEFIELD);
|
||||
Map<UUID, MageObject> LKIBattlefield = game.getLKI().get(Zone.BATTLEFIELD);
|
||||
if (LKIBattlefield != null) {
|
||||
for (MageObject mageObject : LKIBattlefield.values()) {
|
||||
Permanent perm = (Permanent) mageObject;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import mage.game.permanent.Permanent;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
|
@ -104,7 +105,7 @@ public class GainAbilityControlledEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
}
|
||||
// still as long as the prev. permanent is known to the LKI (e.g. Mikaeus, the Unhallowed) so gained dies triggered ability will trigger
|
||||
HashMap<UUID, MageObject> LKIBattlefield = game.getLKI().get(Zone.BATTLEFIELD);
|
||||
Map<UUID, MageObject> LKIBattlefield = game.getLKI().get(Zone.BATTLEFIELD);
|
||||
if (LKIBattlefield != null) {
|
||||
for (MageObject mageObject : LKIBattlefield.values()) {
|
||||
Permanent perm = (Permanent) mageObject;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package mage.abilities.effects.common.continuous;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectReference;
|
||||
|
|
@ -104,7 +105,7 @@ public class LoseAbilityAllEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
}
|
||||
// still as long as the prev. permanent is known to the LKI (e.g. Mikaeus, the Unhallowed) so gained dies triggered ability will trigger
|
||||
HashMap<UUID, MageObject> LKIBattlefield = game.getLKI().get(Zone.BATTLEFIELD);
|
||||
Map<UUID, MageObject> LKIBattlefield = game.getLKI().get(Zone.BATTLEFIELD);
|
||||
if (LKIBattlefield != null) {
|
||||
for (MageObject mageObject : LKIBattlefield.values()) {
|
||||
Permanent perm = (Permanent) mageObject;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
package mage.abilities.effects.common.continuous;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
|
|
@ -45,7 +46,7 @@ public class PlayWithHandRevealedEffect extends ContinuousEffectImpl {
|
|||
affectedPlayers = game.getOpponents(source.getControllerId());
|
||||
break;
|
||||
case YOU:
|
||||
ArrayList<UUID> tmp = new ArrayList<>();
|
||||
List<UUID> tmp = new ArrayList<>();
|
||||
tmp.add(source.getControllerId());
|
||||
affectedPlayers = tmp;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package mage.abilities.effects.common.counter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -79,7 +80,7 @@ public class AddCountersSourceEffect extends OneShotEffect {
|
|||
countersToAdd--;
|
||||
}
|
||||
newCounter.add(countersToAdd);
|
||||
ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects");
|
||||
List<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects");
|
||||
card.addCounters(newCounter, source, game, appliedEffects);
|
||||
if (informPlayers && !game.isSimulation()) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
|
|
@ -107,7 +108,7 @@ public class AddCountersSourceEffect extends OneShotEffect {
|
|||
}
|
||||
newCounter.add(countersToAdd);
|
||||
int before = permanent.getCounters(game).getCount(newCounter.getName());
|
||||
ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects");
|
||||
List<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects");
|
||||
permanent.addCounters(newCounter, source, game, appliedEffects); // if used from a replacement effect, the basic event determines if an effect was already applied to an event
|
||||
if (informPlayers && !game.isSimulation()) {
|
||||
int amountAdded = permanent.getCounters(game).getCount(newCounter.getName()) - before;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import mage.target.common.TargetDiscard;
|
|||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class DiscardEachPlayerEffect extends OneShotEffect {
|
||||
|
|
@ -60,7 +61,7 @@ public class DiscardEachPlayerEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
// Store for each player the cards to discard, that's important because all discard shall happen at the same time
|
||||
HashMap<UUID, Cards> cardsToDiscard = new HashMap<>();
|
||||
Map<UUID, Cards> cardsToDiscard = new HashMap<>();
|
||||
if (controller != null) {
|
||||
// choose cards to discard
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class AddConditionalManaOfTwoDifferentColorsEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
ArrayList<Mana> netMana = new ArrayList<>();
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(Mana.AnyMana(2));
|
||||
return netMana;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class AddManaAnyColorAttachedControllerEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
ArrayList<Mana> netMana = new ArrayList<>();
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(Mana.AnyMana(1));
|
||||
return netMana;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class AddManaInAnyCombinationEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
ArrayList<Mana> netMana = new ArrayList<>();
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
int amountOfManaLeft = amount.calculate(game, source, this);
|
||||
if (amountOfManaLeft > 0) {
|
||||
netMana.add(Mana.AnyMana(amountOfManaLeft));
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class AddManaOfAnyTypeProducedEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
ArrayList<Mana> netMana = new ArrayList<>();
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
Mana types = (Mana) this.getValue("mana"); // TODO: will not work until TriggeredManaAbility fix (see TriggeredManaAbilityMustGivesExtraManaOptions test)
|
||||
if (types != null) {
|
||||
netMana.add(types.copy());
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class AddManaOfTwoDifferentColorsEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
ArrayList<Mana> netMana = new ArrayList<>();
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(Mana.AnyMana(2));
|
||||
return netMana;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class AddManaToManaPoolTargetControllerEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public List<Mana> getNetMana(Game game, Ability source) {
|
||||
ArrayList<Mana> netMana = new ArrayList<>();
|
||||
List<Mana> netMana = new ArrayList<>();
|
||||
netMana.add(mana.copy());
|
||||
return netMana;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue