mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-29 07:23:52 +08:00
27 lines
577 B
Java
27 lines
577 B
Java
package emu.grasscutter.data.common;
|
|
|
|
public class ItemParamStringData {
|
|
private int id;
|
|
private String count;
|
|
|
|
public ItemParamStringData() {}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public String getCount() {
|
|
return count;
|
|
}
|
|
|
|
public ItemParamData toItemParamData() {
|
|
if (count.contains(";")) {
|
|
String[] split = count.split(";");
|
|
count = count.split(";")[split.length - 1];
|
|
} else if (count.contains(".")) {
|
|
return new ItemParamData(id, (int) Math.ceil(Double.parseDouble(count)));
|
|
}
|
|
return new ItemParamData(id, Integer.parseInt(count));
|
|
}
|
|
}
|