- Correct some code style issues.

This commit is contained in:
Agetian
2018-04-13 21:43:31 +03:00
parent 82bd0325cf
commit e28b683b89
3 changed files with 7 additions and 10 deletions

View File

@@ -97,7 +97,7 @@ public class ComputerUtilCard {
*/ */
public static Card getBestPlaneswalkerAI(final List<Card> list) { public static Card getBestPlaneswalkerAI(final List<Card> list) {
List<Card> all = CardLists.filter(list, CardPredicates.Presets.PLANESWALKERS); List<Card> all = CardLists.filter(list, CardPredicates.Presets.PLANESWALKERS);
if (all.size() == 0) { if (all.isEmpty()) {
return null; return null;
} }
// no AI logic, just return most expensive // no AI logic, just return most expensive
@@ -111,7 +111,7 @@ public class ComputerUtilCard {
*/ */
public static Card getWorstPlaneswalkerAI(final List<Card> list) { public static Card getWorstPlaneswalkerAI(final List<Card> list) {
List<Card> all = CardLists.filter(list, CardPredicates.Presets.PLANESWALKERS); List<Card> all = CardLists.filter(list, CardPredicates.Presets.PLANESWALKERS);
if (all.size() == 0) { if (all.isEmpty()) {
return null; return null;
} }
// no AI logic, just return least expensive // no AI logic, just return least expensive

View File

@@ -84,10 +84,9 @@ public abstract class DamageAiBase extends SpellAbilityAi {
// burn Planeswalkers // burn Planeswalkers
// TODO: Must be removed completely when the "planeswalker redirection" rule is removed. // TODO: Must be removed completely when the "planeswalker redirection" rule is removed.
if (!noPlaneswalkerRedirection) { if (!noPlaneswalkerRedirection
if (Iterables.any(enemy.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANESWALKERS)) { && Iterables.any(enemy.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANESWALKERS)) {
return true; return true;
}
} }
if (avoidTargetP(comp, sa)) { if (avoidTargetP(comp, sa)) {

View File

@@ -361,10 +361,8 @@ public class DamageDealAi extends DamageAiBase {
return ComputerUtilCard.getBestPlaneswalkerAI(killables); return ComputerUtilCard.getBestPlaneswalkerAI(killables);
} }
if (!hPlay.isEmpty()) { if (!hPlay.isEmpty() && pl.isOpponentOf(ai) && activator.equals(ai)) {
if (pl.isOpponentOf(ai) && activator.equals(ai)) { return ComputerUtilCard.getBestPlaneswalkerAI(hPlay);
return ComputerUtilCard.getBestPlaneswalkerAI(hPlay);
}
} }
return null; return null;