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

@ -3352,7 +3352,6 @@ public abstract class PlayerImpl implements Player, Serializable {
}
if (used) {
iterator.remove();
availableMana.removeDuplicated();
anAbilityWasUsed = true;
}
}
@ -3363,9 +3362,8 @@ public abstract class PlayerImpl implements Player, Serializable {
}
}
// remove duplicated variants (see ManaOptionsTest for info - when that rises)
availableMana.removeDuplicated();
availableMana.removeFullyIncludedVariations();
availableMana.remove(new Mana()); // Remove any empty mana that was left over from the way the code is written
game.setCheckPlayableState(oldState);
return availableMana;
}