ItemParamStringData.java 577 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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));
	}
}