forked from External/mage
small optimization to DoIfCostPaid text generation
This commit is contained in:
parent
f38639e1db
commit
3727e2ea42
4 changed files with 12 additions and 30 deletions
|
|
@ -60,6 +60,10 @@ public final class CardUtil {
|
|||
|
||||
public static final SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.SSS");
|
||||
|
||||
private static final List<String> costWords = Arrays.asList(
|
||||
"put", "return", "exile", "discard", "sacrifice", "remove", "tap", "reveal", "pay"
|
||||
);
|
||||
|
||||
/**
|
||||
* Increase spell or ability cost to be paid.
|
||||
*
|
||||
|
|
@ -1169,4 +1173,8 @@ public final class CardUtil {
|
|||
}
|
||||
return zcc;
|
||||
}
|
||||
|
||||
public static boolean checkCostWords(String text) {
|
||||
return text != null && costWords.stream().anyMatch(text.toLowerCase(Locale.ENGLISH)::startsWith);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue