Fix copying game objects with chosen things (for simulation AI).

This commit is contained in:
Myrd
2015-03-03 00:50:52 +00:00
parent f064fd5602
commit 3b54fd2fce
2 changed files with 29 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import java.util.Map.Entry;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.Lists;
import forge.LobbyPlayer;
import forge.ai.LobbyPlayerAi;
@@ -254,10 +255,19 @@ public class GameCopier {
newCard.addCounter(CounterType.valueOf(str), count, false);
}
}
// TODO: Other chosen things...
if (c.getChosenPlayer() != null) {
newCard.setChosenPlayer(playerMap.get(c.getChosenPlayer()));
}
if (!c.getChosenType().isEmpty()) {
newCard.setChosenType(c.getChosenType());
}
if (c.getChosenColors() != null) {
newCard.setChosenColors(Lists.newArrayList(c.getChosenColors()));
}
if (!c.getNamedCard().isEmpty()) {
newCard.setNamedCard(c.getNamedCard());
}
// TODO: FIXME
if (c.hasRemembered()) {
for (Object o : c.getRemembered()) {