EquipAffixData.java 1.22 KB
Newer Older
Melledy's avatar
Melledy committed
1
package emu.grasscutter.data.excels;
Melledy's avatar
Melledy committed
2
3

import java.util.ArrayList;
4
import emu.grasscutter.data.GameResource;
Melledy's avatar
Melledy committed
5
6
7
8
import emu.grasscutter.data.ResourceType;
import emu.grasscutter.data.common.FightPropData;

@ResourceType(name = "EquipAffixExcelConfigData.json")
9
public class EquipAffixData extends GameResource {
Melledy's avatar
Melledy committed
10

Melledy's avatar
Melledy committed
11
12
13
14
15
16
17
	private int affixId;
    private int id;
    private int level;
    private long nameTextMapHash;
    private String openConfig;
    private FightPropData[] addProps;
    private float[] paramList;
Melledy's avatar
Melledy committed
18
19
20
    
	@Override
	public int getId() {
Melledy's avatar
Melledy committed
21
		return affixId;
Melledy's avatar
Melledy committed
22
23
24
	}
	
	public int getMainId() {
Melledy's avatar
Melledy committed
25
		return id;
Melledy's avatar
Melledy committed
26
27
28
	}

	public int getLevel() {
Melledy's avatar
Melledy committed
29
		return level;
Melledy's avatar
Melledy committed
30
31
32
	}

	public long getNameTextMapHash() {
Melledy's avatar
Melledy committed
33
		return nameTextMapHash;
Melledy's avatar
Melledy committed
34
35
36
	}

	public String getOpenConfig() {
Melledy's avatar
Melledy committed
37
		return openConfig;
Melledy's avatar
Melledy committed
38
39
40
	}

	public FightPropData[] getAddProps() {
Melledy's avatar
Melledy committed
41
		return addProps;
Melledy's avatar
Melledy committed
42
43
44
	}

	public float[] getParamList() {
Melledy's avatar
Melledy committed
45
		return paramList;
Melledy's avatar
Melledy committed
46
47
48
49
50
51
52
53
54
55
56
	}

	@Override
	public void onLoad() {
		ArrayList<FightPropData> parsed = new ArrayList<FightPropData>(getAddProps().length);
		for (FightPropData prop : getAddProps()) {
			if (prop.getPropType() != null || prop.getValue() == 0f) {
				prop.onLoad();
				parsed.add(prop);
			}
		}
Melledy's avatar
Melledy committed
57
		this.addProps = parsed.toArray(new FightPropData[parsed.size()]);
Melledy's avatar
Melledy committed
58
59
	}
}