Refactor: Significant speed-up for ManaOptions (#9233)

This commit is contained in:
Alex Vasile 2022-10-04 00:08:20 -04:00 committed by GitHub
parent 23a4d2640b
commit 55a6acba22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 782 additions and 408 deletions

View file

@ -1536,7 +1536,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
if (!unpaid.getMana().includesMana(mana)) {
continue ManaAbility;
}
colored += mana.countColored();
colored += CardUtil.overflowInc(colored, mana.countColored());
}
if (colored > 1 && (cost instanceof ColoredManaCost)) {
for (Mana netMana : manaAbility.getNetMana(game)) {
@ -1773,7 +1773,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
a2Max = netMana.count();
}
}
return a2Max - a1Max;
return CardUtil.overflowDec(a2Max, a1Max);
}
});
}