update to alpha.10

This commit is contained in:
okx-code
2018-08-23 23:32:19 +01:00
parent 703342024d
commit be5ee90036
9 changed files with 54 additions and 35 deletions
@@ -11,20 +11,13 @@ public enum Variable {
RANK_NAME,
MONEY,
MONEY_NEEDED,
AMOUNT,
AMOUNT_NEEDED,
PERCENT_DONE,
PERCENT_LEFT;
public static Variable getVariable(String name) {
for(Variable variable : values()) {
if(variable.toString().equalsIgnoreCase(name)) {
return variable;
}
}
return null;
}
public String replace(String message, String value) {
Pattern pattern = Pattern.compile("\\{" + this + "}", Pattern.CASE_INSENSITIVE);
public String replace(String message, String value, String type) {
Pattern pattern = Pattern.compile("\\{" + type + "_" + this + "}", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(message);
return matcher.replaceAll(value);
}