mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
refactor: improved ability's modes code (related to #11333)
This commit is contained in:
parent
fec5de873b
commit
b7ce9c80f0
32 changed files with 162 additions and 137 deletions
|
|
@ -454,7 +454,7 @@ public class TestPlayer implements Player {
|
|||
Mode selectedMode;
|
||||
if (targetName.startsWith("mode=")) {
|
||||
int modeNr = Integer.parseInt(targetName.substring(5, 6));
|
||||
if (modeNr == 0 || modeNr > (ability.getModes().isEachModeMoreThanOnce() ? ability.getModes().getSelectedModes().size() : ability.getModes().size())) {
|
||||
if (modeNr == 0 || modeNr > (ability.getModes().isMayChooseSameModeMoreThanOnce() ? ability.getModes().getSelectedModes().size() : ability.getModes().size())) {
|
||||
throw new UnsupportedOperationException("Given mode number (" + modeNr + ") not available for " + ability.toString());
|
||||
}
|
||||
UUID modeId = ability.getModes().getModeId(modeNr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue