Commit a23b29b6 authored by Melledy's avatar Melledy
Browse files

Rename excel classes

parent f1398182
......@@ -4,7 +4,7 @@ import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.ItemData;
import emu.grasscutter.data.excels.ItemData;
import emu.grasscutter.game.entity.EntityItem;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.utils.Position;
......
......@@ -4,8 +4,8 @@ import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.AvatarData;
import emu.grasscutter.data.def.ItemData;
import emu.grasscutter.data.excels.AvatarData;
import emu.grasscutter.data.excels.ItemData;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.game.inventory.ItemType;
......
......@@ -4,7 +4,7 @@ import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.ItemData;
import emu.grasscutter.data.excels.ItemData;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.game.inventory.ItemType;
import emu.grasscutter.game.player.Player;
......
......@@ -4,7 +4,7 @@ import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.AvatarData;
import emu.grasscutter.data.excels.AvatarData;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.player.Player;
......
......@@ -3,7 +3,7 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.ItemData;
import emu.grasscutter.data.excels.ItemData;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.game.inventory.ItemType;
import emu.grasscutter.game.player.Player;
......
......@@ -4,10 +4,10 @@ import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.AvatarData;
import emu.grasscutter.data.def.GadgetData;
import emu.grasscutter.data.def.ItemData;
import emu.grasscutter.data.def.MonsterData;
import emu.grasscutter.data.excels.AvatarData;
import emu.grasscutter.data.excels.GadgetData;
import emu.grasscutter.data.excels.ItemData;
import emu.grasscutter.data.excels.MonsterData;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.entity.*;
import emu.grasscutter.game.player.Player;
......
......@@ -3,7 +3,7 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.data.def.AvatarSkillDepotData;
import emu.grasscutter.data.excels.AvatarSkillDepotData;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.entity.EntityAvatar;
import emu.grasscutter.game.player.Player;
......
......@@ -8,12 +8,12 @@ import java.util.Map;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.utils.Utils;
import emu.grasscutter.data.custom.AbilityEmbryoEntry;
import emu.grasscutter.data.custom.AbilityModifierEntry;
import emu.grasscutter.data.custom.OpenConfigEntry;
import emu.grasscutter.data.custom.MainQuestData;
import emu.grasscutter.data.custom.ScenePointEntry;
import emu.grasscutter.data.def.*;
import emu.grasscutter.data.binout.AbilityEmbryoEntry;
import emu.grasscutter.data.binout.AbilityModifierEntry;
import emu.grasscutter.data.binout.MainQuestData;
import emu.grasscutter.data.binout.OpenConfigEntry;
import emu.grasscutter.data.binout.ScenePointEntry;
import emu.grasscutter.data.excels.*;
import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
......
......@@ -7,8 +7,8 @@ import org.danilopianini.util.FlexibleQuadTree;
import org.danilopianini.util.SpatialIndex;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.def.ReliquaryAffixData;
import emu.grasscutter.data.def.ReliquaryMainPropData;
import emu.grasscutter.data.excels.ReliquaryAffixData;
import emu.grasscutter.data.excels.ReliquaryMainPropData;
import emu.grasscutter.game.world.SpawnDataEntry;
import emu.grasscutter.game.world.SpawnDataEntry.SpawnGroupEntry;
import emu.grasscutter.utils.WeightedList;
......
......@@ -14,17 +14,17 @@ import com.google.gson.JsonElement;
import com.google.gson.reflect.TypeToken;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.binout.AbilityEmbryoEntry;
import emu.grasscutter.data.binout.AbilityModifier;
import emu.grasscutter.data.binout.AbilityModifierEntry;
import emu.grasscutter.data.binout.MainQuestData;
import emu.grasscutter.data.binout.OpenConfigEntry;
import emu.grasscutter.data.binout.ScenePointEntry;
import emu.grasscutter.data.binout.AbilityModifier.AbilityConfigData;
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction;
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierActionType;
import emu.grasscutter.data.common.PointData;
import emu.grasscutter.data.common.ScenePointConfig;
import emu.grasscutter.data.custom.AbilityEmbryoEntry;
import emu.grasscutter.data.custom.AbilityModifier;
import emu.grasscutter.data.custom.AbilityModifier.AbilityConfigData;
import emu.grasscutter.data.custom.AbilityModifier.AbilityModifierAction;
import emu.grasscutter.data.custom.AbilityModifier.AbilityModifierActionType;
import emu.grasscutter.data.custom.AbilityModifierEntry;
import emu.grasscutter.data.custom.OpenConfigEntry;
import emu.grasscutter.data.custom.MainQuestData;
import emu.grasscutter.data.custom.ScenePointEntry;
import emu.grasscutter.game.world.SpawnDataEntry.*;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
......@@ -138,18 +138,14 @@ public class ResourceLoader {
@SuppressWarnings({"rawtypes", "unchecked"})
protected static void loadFromResource(Class<?> c, String fileName, Int2ObjectMap map) throws Exception {
FileReader fileReader = new FileReader(RESOURCE("ExcelBinOutput/" + fileName));
Gson gson = Grasscutter.getGsonFactory();
List list = gson.fromJson(fileReader, List.class);
for (Object o : list) {
Map<String, Object> tempMap = Utils.switchPropertiesUpperLowerCase((Map<String, Object>) o, c);
GameResource res = gson.fromJson(gson.toJson(tempMap), TypeToken.get(c).getType());
res.onLoad();
if(map.containsKey(res.getId())) {
map.remove(res.getId());
try (FileReader fileReader = new FileReader(RESOURCE("ExcelBinOutput/" + fileName))) {
List list = Grasscutter.getGsonFactory().fromJson(fileReader, TypeToken.getParameterized(Collection.class, c).getType());
for (Object o : list) {
GameResource res = (GameResource) o;
res.onLoad();
map.put(res.getId(), res);
}
map.put(res.getId(), res);
}
}
......
package emu.grasscutter.data.custom;
package emu.grasscutter.data.binout;
public class AbilityEmbryoEntry {
private String name;
......
package emu.grasscutter.data.custom;
package emu.grasscutter.data.binout;
import java.util.Map;
......
package emu.grasscutter.data.custom;
package emu.grasscutter.data.binout;
import java.util.ArrayList;
import java.util.List;
import emu.grasscutter.data.custom.AbilityModifier.AbilityModifierAction;
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction;
public class AbilityModifierEntry {
private String name; // Custom value
......
package emu.grasscutter.data.custom;
package emu.grasscutter.data.binout;
import emu.grasscutter.game.quest.enums.LogicType;
import emu.grasscutter.game.quest.enums.QuestTrigger;
......
package emu.grasscutter.data.custom;
package emu.grasscutter.data.binout;
import java.util.ArrayList;
import java.util.List;
......
package emu.grasscutter.data.custom;
import emu.grasscutter.data.common.PointData;
public class ScenePointEntry {
private String name;
private PointData pointData;
public ScenePointEntry(String name, PointData pointData) {
this.name = name;
this.pointData = pointData;
}
public String getName() {
return name;
}
public PointData getPointData() {
return pointData;
}
}
package emu.grasscutter.data.binout;
import emu.grasscutter.data.common.PointData;
public class ScenePointEntry {
private String name;
private PointData pointData;
public ScenePointEntry(String name, PointData pointData) {
this.name = name;
this.pointData = pointData;
}
public String getName() {
return name;
}
public PointData getPointData() {
return pointData;
}
}
package emu.grasscutter.data.common;
public class CurveInfo {
private String Type;
private String Arith;
private float Value;
private String type;
private String arith;
private float value;
public String getType() {
return Type;
return type;
}
public String getArith() {
return Arith;
return arith;
}
public float getValue() {
return Value;
return value;
}
}
......@@ -3,16 +3,16 @@ package emu.grasscutter.data.common;
import emu.grasscutter.game.props.FightProperty;
public class FightPropData {
private String PropType;
private String propType;
private FightProperty prop;
private float Value;
private float value;
public String getPropType() {
return PropType;
return propType;
}
public float getValue() {
return Value;
return value;
}
public FightProperty getProp() {
......@@ -20,6 +20,6 @@ public class FightPropData {
}
public void onLoad() {
this.prop = FightProperty.getPropByName(PropType);
this.prop = FightProperty.getPropByName(propType);
}
}
\ No newline at end of file
......@@ -3,31 +3,31 @@ package emu.grasscutter.data.common;
import com.google.gson.annotations.SerializedName;
public class ItemParamData {
@SerializedName(value="Id", alternate={"ItemId"})
private int Id;
@SerializedName(value="Id", alternate={"itemId"})
private int id;
@SerializedName(value="Count", alternate={"ItemCount"})
private int Count;
@SerializedName(value="Count", alternate={"itemCount"})
private int count;
public ItemParamData() {}
public ItemParamData(int id, int count) {
this.Id = id;
this.Count = count;
this.id = id;
this.count = count;
}
public int getId() {
return Id;
return id;
}
public int getItemId() {
return Id;
return id;
}
public int getCount() {
return Count;
return count;
}
public int getItemCount() {
return Count;
return count;
}
}
package emu.grasscutter.data.common;
public class ItemParamStringData {
private int Id;
private String Count;
private int id;
private String count;
public ItemParamStringData() {}
public int getId() {
return Id;
return id;
}
public String getCount() {
return Count;
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)));
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));
return new ItemParamData(id, Integer.parseInt(count));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment