[Simulated AI] Remove SIMULATE_LAND_PLAYS constant since it's enabled by default now.

This commit is contained in:
Myrd
2016-12-31 18:38:52 +00:00
parent 52711b7b33
commit 51af35db2e
2 changed files with 11 additions and 19 deletions

View File

@@ -1037,7 +1037,7 @@ public class AiController {
// re-created if needed and used for any AI logic that needs it.
predictedCombat = null;
if (useSimulation && (SpellAbilityPicker.SIMULATE_LAND_PLAYS || simPicker.hasActivePlan())) {
if (useSimulation) {
return singleSpellAbilityList(simPicker.chooseSpellAbilityToPlay(null));
}
@@ -1057,10 +1057,6 @@ public class AiController {
}
}
if (useSimulation && !SpellAbilityPicker.SIMULATE_LAND_PLAYS) {
return singleSpellAbilityList(simPicker.chooseSpellAbilityToPlay(null));
}
return singleSpellAbilityList(getSpellAbilityToPlay());
}

View File

@@ -27,8 +27,6 @@ import forge.game.spellability.SpellAbilityCondition;
import forge.game.zone.ZoneType;
public class SpellAbilityPicker {
public static boolean SIMULATE_LAND_PLAYS = true;
private Game game;
private Player player;
private Score bestScore;
@@ -94,19 +92,17 @@ public class SpellAbilityPicker {
CardCollection cards = ComputerUtilAbility.getAvailableCards(game, player);
List<SpellAbility> all = ComputerUtilAbility.getSpellAbilities(cards, player);
if (SIMULATE_LAND_PLAYS) {
CardCollection landsToPlay = ComputerUtilAbility.getAvailableLandsToPlay(game, player);
if (landsToPlay != null) {
HashMap<String, Card> landsDeDupe = new HashMap<String, Card>();
for (Card land : landsToPlay) {
Card previousLand = landsDeDupe.get(land.getName());
// Skip identical lands.
if (previousLand != null && previousLand.getZone() == land.getZone() && previousLand.getOwner() == land.getOwner()) {
continue;
}
landsDeDupe.put(land.getName(), land);
all.add(new PlayLandAbility(land));
CardCollection landsToPlay = ComputerUtilAbility.getAvailableLandsToPlay(game, player);
if (landsToPlay != null) {
HashMap<String, Card> landsDeDupe = new HashMap<String, Card>();
for (Card land : landsToPlay) {
Card previousLand = landsDeDupe.get(land.getName());
// Skip identical lands.
if (previousLand != null && previousLand.getZone() == land.getZone() && previousLand.getOwner() == land.getOwner()) {
continue;
}
landsDeDupe.put(land.getName(), land);
all.add(new PlayLandAbility(land));
}
}