forked from External/mage
Removed exception for missing subType to prevent empty card list in older deck editors.
This commit is contained in:
parent
d66a9d1693
commit
afd6bc080d
2 changed files with 19 additions and 19 deletions
|
|
@ -5,7 +5,6 @@ import java.util.Arrays;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import mage.constants.SubType;
|
||||
|
||||
public class SubTypeList extends ArrayList<SubType> {
|
||||
|
|
@ -13,30 +12,33 @@ public class SubTypeList extends ArrayList<SubType> {
|
|||
@Deprecated
|
||||
public boolean addAll(List<String> subtypes) {
|
||||
return addAll(subtypes.stream()
|
||||
.map(SubType::byDescription)
|
||||
.collect(Collectors.toList()));
|
||||
.map(SubType::byDescription)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean removeAll(List<String> subtypes){
|
||||
public boolean removeAll(List<String> subtypes) {
|
||||
return removeAll(subtypes.stream()
|
||||
.map(SubType::byDescription)
|
||||
.collect(Collectors.toList()));
|
||||
.map(SubType::byDescription)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
|
||||
public boolean add(SubType... subTypes) {
|
||||
return Collections.addAll(this, subTypes);
|
||||
}
|
||||
|
||||
public boolean removeAll(SubType... subTypes) {
|
||||
return super.removeAll(Arrays.stream(subTypes)
|
||||
.collect(Collectors.toList()));
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean add(String s) {
|
||||
return add(SubType.byDescription(s));
|
||||
SubType subType = SubType.byDescription(s);
|
||||
if (subType != null) {
|
||||
return add(subType);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue