change map for list

This commit is contained in:
ingmargoudt 2017-03-20 10:39:28 +01:00 committed by drmDev
parent 5c34022175
commit 59eb2ed568

View file

@ -47,12 +47,12 @@ import mage.players.PlayerList;
import mage.target.Target; import mage.target.Target;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Objects; import java.util.Objects;
import java.util.UUID; import java.util.UUID;
/** /**
*
* @author spjspj * @author spjspj
*/ */
public class KynaiosAndTiroOfMeletis extends CardImpl { public class KynaiosAndTiroOfMeletis extends CardImpl {
@ -100,7 +100,6 @@ class KynaiosAndTirosEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (controller != null) { if (controller != null) {
controller.drawCards(1, game); controller.drawCards(1, game);
PlayerList playerList = game.getState().getPlayerList().copy(); PlayerList playerList = game.getState().getPlayerList().copy();
@ -111,7 +110,7 @@ class KynaiosAndTirosEffect extends OneShotEffect {
Player currentPlayer = game.getPlayer(playerList.get()); Player currentPlayer = game.getPlayer(playerList.get());
UUID firstInactivePlayer = null; UUID firstInactivePlayer = null;
Target target = new TargetCardInHand(filter); Target target = new TargetCardInHand(filter);
HashMap<UUID, Boolean> noLandPlayers = new HashMap<>(); ArrayList<UUID> noLandPlayers = new ArrayList<>();
while (controller.canRespond()) { while (controller.canRespond()) {
if (currentPlayer != null && currentPlayer.canRespond() && game.getState().getPlayersInRange(controller.getId(), game).contains(currentPlayer.getId())) { if (currentPlayer != null && currentPlayer.canRespond() && game.getState().getPlayersInRange(controller.getId(), game).contains(currentPlayer.getId())) {
@ -130,7 +129,7 @@ class KynaiosAndTirosEffect extends OneShotEffect {
} }
} }
if (!playedLand && !Objects.equals(currentPlayer, controller)) { if (!playedLand && !Objects.equals(currentPlayer, controller)) {
noLandPlayers.put(currentPlayer.getId(), playedLand); noLandPlayers.add(currentPlayer.getId());
} }
} }
// get next player // get next player
@ -142,7 +141,7 @@ class KynaiosAndTirosEffect extends OneShotEffect {
} }
} }
for (UUID playerId : noLandPlayers.keySet()) { for (UUID playerId : noLandPlayers) {
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
if (player.chooseUse(outcome.DrawCard, "Draw a card?", source, game)) { if (player.chooseUse(outcome.DrawCard, "Draw a card?", source, game)) {