mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Merge branch 'master' of https://git.cardforge.org/core-developers/forge.git
This commit is contained in:
@@ -610,8 +610,14 @@ public class AiController {
|
|||||||
ComputerUtilAbility.getAvailableCards(game, player);
|
ComputerUtilAbility.getAvailableCards(game, player);
|
||||||
|
|
||||||
List<SpellAbility> all = ComputerUtilAbility.getSpellAbilities(cards, player);
|
List<SpellAbility> all = ComputerUtilAbility.getSpellAbilities(cards, player);
|
||||||
ComparatorUtil.verifyTransitivity(saComparator, all);
|
|
||||||
|
try {
|
||||||
Collections.sort(all, saComparator); // put best spells first
|
Collections.sort(all, saComparator); // put best spells first
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException ex) {
|
||||||
|
System.err.println(ex.getMessage());
|
||||||
|
ComparatorUtil.verifyTransitivity(saComparator, all);
|
||||||
|
}
|
||||||
|
|
||||||
for (final SpellAbility sa : ComputerUtilAbility.getOriginalAndAltCostAbilities(all, player)) {
|
for (final SpellAbility sa : ComputerUtilAbility.getOriginalAndAltCostAbilities(all, player)) {
|
||||||
ApiType saApi = sa.getApi();
|
ApiType saApi = sa.getApi();
|
||||||
@@ -1574,8 +1580,13 @@ public class AiController {
|
|||||||
if (all == null || all.isEmpty())
|
if (all == null || all.isEmpty())
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
ComparatorUtil.verifyTransitivity(saComparator, all);
|
try {
|
||||||
Collections.sort(all, saComparator); // put best spells first
|
Collections.sort(all, saComparator); // put best spells first
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException ex) {
|
||||||
|
System.err.println(ex.getMessage());
|
||||||
|
ComparatorUtil.verifyTransitivity(saComparator, all);
|
||||||
|
}
|
||||||
|
|
||||||
for (final SpellAbility sa : ComputerUtilAbility.getOriginalAndAltCostAbilities(all, player)) {
|
for (final SpellAbility sa : ComputerUtilAbility.getOriginalAndAltCostAbilities(all, player)) {
|
||||||
// Don't add Counterspells to the "normal" playcard lookups
|
// Don't add Counterspells to the "normal" playcard lookups
|
||||||
|
|||||||
Reference in New Issue
Block a user