Changed overrides into operations. Added priority and isLast values to operations.
This commit is contained in:
57
src/main/java/dev/micle/xptools/config/OperationItem.java
Normal file
57
src/main/java/dev/micle/xptools/config/OperationItem.java
Normal file
@ -0,0 +1,57 @@
|
||||
package dev.micle.xptools.config;
|
||||
|
||||
public class OperationItem {
|
||||
private boolean isTag;
|
||||
private String id;
|
||||
private OperationType type;
|
||||
private float min;
|
||||
private float max;
|
||||
private int priority;
|
||||
private boolean isLast;
|
||||
|
||||
public OperationItem(String configString) {
|
||||
String[] splitString = configString.split(",");
|
||||
|
||||
if (splitString.length == 6) {
|
||||
isTag = splitString[0].startsWith("#");
|
||||
id = isTag ? splitString[0].substring(1) : splitString[0];
|
||||
|
||||
type = OperationType.valueOf(splitString[1]);
|
||||
|
||||
min = Float.parseFloat(splitString[2]);
|
||||
max = Float.parseFloat(splitString[3]);
|
||||
|
||||
priority = Integer.parseInt(splitString[4]);
|
||||
|
||||
isLast = Boolean.parseBoolean(splitString[5]);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isTag() {
|
||||
return isTag;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public OperationType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public float getMin() {
|
||||
return min;
|
||||
}
|
||||
|
||||
public float getMax() {
|
||||
return max;
|
||||
}
|
||||
|
||||
public float getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
public boolean isLast() {
|
||||
return isLast;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user