mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
ComputerUtilCard: add getMostProminentBasicLandType and a more generic getMostProminentType
change getMostProminentCreatureType to use the generic form too
This commit is contained in:
@@ -570,6 +570,10 @@ public class ComputerUtilCard {
|
|||||||
return maxName;
|
return maxName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getMostProminentBasicLandType(final CardCollectionView list) {
|
||||||
|
return getMostProminentType(list, CardType.getBasicTypes());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* getMostProminentCreatureType.
|
* getMostProminentCreatureType.
|
||||||
@@ -579,6 +583,10 @@ public class ComputerUtilCard {
|
|||||||
* @return a {@link java.lang.String} object.
|
* @return a {@link java.lang.String} object.
|
||||||
*/
|
*/
|
||||||
public static String getMostProminentCreatureType(final CardCollectionView list) {
|
public static String getMostProminentCreatureType(final CardCollectionView list) {
|
||||||
|
return getMostProminentType(list, CardType.getAllCreatureTypes());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getMostProminentType(final CardCollectionView list, final List<String> valid) {
|
||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -587,7 +595,7 @@ public class ComputerUtilCard {
|
|||||||
|
|
||||||
for (final Card c : list) {
|
for (final Card c : list) {
|
||||||
for (final String var : c.getType()) {
|
for (final String var : c.getType()) {
|
||||||
if (CardType.isACreatureType(var)) {
|
if (valid.contains(var)) {
|
||||||
if (!map.containsKey(var)) {
|
if (!map.containsKey(var)) {
|
||||||
map.put(var, 1);
|
map.put(var, 1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user