AvatarCurveData.java 822 Bytes
Newer Older
Melledy's avatar
Melledy committed
1
package emu.grasscutter.data.excels;
Melledy's avatar
Melledy committed
2
3
4
5
6

import java.util.HashMap;
import java.util.Map;
import java.util.stream.Stream;

7
import emu.grasscutter.data.GameResource;
Melledy's avatar
Melledy committed
8
9
10
11
import emu.grasscutter.data.ResourceType;
import emu.grasscutter.data.common.CurveInfo;

@ResourceType(name = "AvatarCurveExcelConfigData.json")
12
public class AvatarCurveData extends GameResource {
Melledy's avatar
Melledy committed
13
14
	private int level;
	private CurveInfo[] curveInfos;
Melledy's avatar
Melledy committed
15
    
Melledy's avatar
Melledy committed
16
    private Map<String, Float> curveInfoMap;
Melledy's avatar
Melledy committed
17
18
19
	
	@Override
	public int getId() {
Melledy's avatar
Melledy committed
20
		return this.level;
Melledy's avatar
Melledy committed
21
22
23
	}
	
	public int getLevel() {
Melledy's avatar
Melledy committed
24
		return level;
Melledy's avatar
Melledy committed
25
26
27
	}
	
	public Map<String, Float> getCurveInfos() {
Melledy's avatar
Melledy committed
28
		return curveInfoMap;
Melledy's avatar
Melledy committed
29
30
31
32
	}
	
	@Override
	public void onLoad() {
Melledy's avatar
Melledy committed
33
34
		this.curveInfoMap = new HashMap<>();
		Stream.of(this.curveInfos).forEach(info -> this.curveInfoMap.put(info.getType(), info.getValue()));
Melledy's avatar
Melledy committed
35
36
	}
}