- Extracted reveal to players function into Game.

- Cascade will no longer call GuiChoose for AI vs AI matches
This commit is contained in:
Sol
2013-05-31 02:25:35 +00:00
parent b9419f44e2
commit e7ae35a147
3 changed files with 14 additions and 7 deletions

View File

@@ -8,6 +8,7 @@ import java.util.Random;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import forge.Card;
import forge.CardCharacteristicName;
@@ -1346,12 +1347,7 @@ public class ChangeZoneAi extends SpellAbilityAi {
&& !sa.hasParam("NoReveal")) {
final String picked = player + " picked:";
List<Player> otherPlayers = game.getPlayers();
for (Player p : otherPlayers) {
if (!p.equals(player)) {
p.getController().reveal(picked, fetched, destination, player);
}
}
game.revealToPlayers(picked, fetched, destination, Lists.newArrayList(player));
}
} // end changeHiddenOriginResolveAI

View File

@@ -19,6 +19,7 @@ package forge.game;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -640,4 +641,13 @@ public class Game {
public void setAge(GameAge value) {
age = value;
}
public void revealToPlayers(String string, Collection<Card> cards, ZoneType zone, List<Player> skipReveal) {
List<Player> allPlayers = this.getPlayers();
for (Player p : allPlayers) {
if (skipReveal != null && !skipReveal.contains(p)) {
p.getController().reveal(string, cards, zone, p);
}
}
}
}

View File

@@ -116,7 +116,8 @@ public final class GameActionUtil {
}
} // while
GuiChoose.oneOrNone("Revealed cards:", revealed);
game.revealToPlayers("Revealed Cascade Cards:", revealed, ZoneType.Library, null);
if (cascadedCard != null) {
Player p = cascadedCard.getController();