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

View File

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

View File

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