forked from External/mage
-setStrictChooseMode and assertAllCommandsUsed in every test
-store filter info in GameState -put instead of putIfAbsent
This commit is contained in:
parent
7c4d86f583
commit
1dc305f329
6 changed files with 42 additions and 32 deletions
|
|
@ -70,9 +70,6 @@ import java.io.IOException;
|
|||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
|
||||
public abstract class GameImpl implements Game, Serializable {
|
||||
|
||||
|
|
@ -149,8 +146,6 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
// temporary store for income concede commands, don't copy
|
||||
private final LinkedList<UUID> concedingPlayers = new LinkedList<>();
|
||||
|
||||
private Map<UUID, FilterCreaturePermanent> usePowerInsteadOfToughnessForDamageLethalityFilters = new HashMap<>();
|
||||
|
||||
public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife, int startingSize) {
|
||||
this.id = UUID.randomUUID();
|
||||
this.range = range;
|
||||
|
|
@ -1897,7 +1892,7 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
|
||||
List<Permanent> legendary = new ArrayList<>();
|
||||
List<Permanent> worldEnchantment = new ArrayList<>();
|
||||
List<FilterCreaturePermanent> usePowerInsteadOfToughnessForDamageLethalityFilters = getActivePowerInsteadOfToughnessForDamageLethalityFilters();
|
||||
List<FilterCreaturePermanent> usePowerInsteadOfToughnessForDamageLethalityFilters = getState().getActivePowerInsteadOfToughnessForDamageLethalityFilters();
|
||||
for (Permanent perm : getBattlefield().getAllActivePermanents()) {
|
||||
if (perm.isCreature()) {
|
||||
//20091005 - 704.5f
|
||||
|
|
@ -3320,18 +3315,4 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
public Set<UUID> getCommandersIds(Player player, CommanderCardType commanderCardType) {
|
||||
return player.getCommandersIds();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPowerInsteadOfToughnessForDamageLethalityFilter(UUID source, FilterCreaturePermanent filter) {
|
||||
usePowerInsteadOfToughnessForDamageLethalityFilters.putIfAbsent(source, filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FilterCreaturePermanent> getActivePowerInsteadOfToughnessForDamageLethalityFilters() {
|
||||
return usePowerInsteadOfToughnessForDamageLethalityFilters.isEmpty() ? emptyList() : getBattlefield().getAllActivePermanents().stream()
|
||||
.map(Card::getId)
|
||||
.filter(usePowerInsteadOfToughnessForDamageLethalityFilters::containsKey)
|
||||
.map(usePowerInsteadOfToughnessForDamageLethalityFilters::get)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue