mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-17 09:25:06 +01:00
Merge branch 'development' into startMail
This commit is contained in:
@@ -61,9 +61,12 @@ public class GameData {
|
||||
private static final Int2ObjectMap<FetterCharacterCardData> fetterCharacterCardDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<RewardData> rewardDataMap = new Int2ObjectOpenHashMap<>();
|
||||
private static final Int2ObjectMap<WorldLevelData> worldLevelDataMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
private static final Int2ObjectMap<ShopGoodsData> shopGoodsDataMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
// Cache
|
||||
private static Map<Integer, List<Integer>> fetters = new HashMap<>();
|
||||
private static Map<Integer, List<ShopGoodsData>> shopGoods = new HashMap<>();
|
||||
|
||||
public static Int2ObjectMap<?> getMapByResourceDef(Class<?> resourceDefinition) {
|
||||
Int2ObjectMap<?> map = null;
|
||||
@@ -266,5 +269,17 @@ public class GameData {
|
||||
return worldLevelDataMap;
|
||||
}
|
||||
|
||||
public static char EJWOA = 's';
|
||||
public static char EJWOA = 's';
|
||||
|
||||
public static Map<Integer, List<ShopGoodsData>> getShopGoodsDataEntries() {
|
||||
if (shopGoods.isEmpty()) {
|
||||
shopGoodsDataMap.forEach((k, v) -> {
|
||||
if (!shopGoods.containsKey(v.getShopType()))
|
||||
shopGoods.put(v.getShopType(), new ArrayList<>());
|
||||
shopGoods.get(v.getShopType()).add(v);
|
||||
});
|
||||
}
|
||||
|
||||
return shopGoods;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,12 @@ package emu.grasscutter.data.common;
|
||||
public class ItemParamData {
|
||||
private int Id;
|
||||
private int Count;
|
||||
|
||||
public ItemParamData() {}
|
||||
public ItemParamData(int id, int count) {
|
||||
this.Id = id;
|
||||
this.Count = count;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return Id;
|
||||
|
||||
@@ -8,14 +8,15 @@ public class GadgetData extends GameResource {
|
||||
private int Id;
|
||||
|
||||
private String Type;
|
||||
private String JsonName;
|
||||
private boolean IsInteractive;
|
||||
private String[] Tags;
|
||||
private String ItemJsonName;
|
||||
private String InteeIconName;
|
||||
private long NameTextMapHash;
|
||||
private int CampID;
|
||||
|
||||
private String JsonName;
|
||||
private boolean IsInteractive;
|
||||
private String[] Tags;
|
||||
private String ItemJsonName;
|
||||
private String InteeIconName;
|
||||
private long NameTextMapHash;
|
||||
private int CampID;
|
||||
private String LODPatternName;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return this.Id;
|
||||
@@ -53,6 +54,8 @@ public class GadgetData extends GameResource {
|
||||
return CampID;
|
||||
}
|
||||
|
||||
public String getLODPatternName() { return LODPatternName; }
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
|
||||
|
||||
108
src/main/java/emu/grasscutter/data/def/ShopGoodsData.java
Normal file
108
src/main/java/emu/grasscutter/data/def/ShopGoodsData.java
Normal file
@@ -0,0 +1,108 @@
|
||||
package emu.grasscutter.data.def;
|
||||
|
||||
import emu.grasscutter.data.GameResource;
|
||||
import emu.grasscutter.data.ResourceType;
|
||||
import emu.grasscutter.data.common.ItemParamData;
|
||||
import emu.grasscutter.game.shop.ShopInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ResourceType(name = "ShopGoodsExcelConfigData.json")
|
||||
public class ShopGoodsData extends GameResource {
|
||||
private int GoodsId;
|
||||
private int ShopType;
|
||||
private int ItemId;
|
||||
|
||||
private int ItemCount;
|
||||
|
||||
private int CostScoin;
|
||||
private int CostHcoin;
|
||||
private int CostMcoin;
|
||||
|
||||
private List<ItemParamData> CostItems;
|
||||
private int MinPlayerLevel;
|
||||
private int MaxPlayerLevel;
|
||||
|
||||
private int BuyLimit;
|
||||
private int SubTabId;
|
||||
|
||||
private String RefreshType;
|
||||
private transient ShopInfo.ShopRefreshType RefreshTypeEnum;
|
||||
|
||||
private int RefreshParam;
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
if (this.RefreshType == null)
|
||||
this.RefreshTypeEnum = ShopInfo.ShopRefreshType.NONE;
|
||||
else {
|
||||
this.RefreshTypeEnum = switch (this.RefreshType) {
|
||||
case "SHOP_REFRESH_DAILY" -> ShopInfo.ShopRefreshType.SHOP_REFRESH_DAILY;
|
||||
case "SHOP_REFRESH_WEEKLY" -> ShopInfo.ShopRefreshType.SHOP_REFRESH_WEEKLY;
|
||||
case "SHOP_REFRESH_MONTHLY" -> ShopInfo.ShopRefreshType.SHOP_REFRESH_MONTHLY;
|
||||
default -> ShopInfo.ShopRefreshType.NONE;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return getGoodsId();
|
||||
}
|
||||
|
||||
public int getGoodsId() {
|
||||
return GoodsId;
|
||||
}
|
||||
|
||||
public int getShopType() {
|
||||
return ShopType;
|
||||
}
|
||||
|
||||
public int getItemId() {
|
||||
return ItemId;
|
||||
}
|
||||
|
||||
public int getItemCount() {
|
||||
return ItemCount;
|
||||
}
|
||||
|
||||
public int getCostScoin() {
|
||||
return CostScoin;
|
||||
}
|
||||
|
||||
public int getCostHcoin() {
|
||||
return CostHcoin;
|
||||
}
|
||||
|
||||
public int getCostMcoin() {
|
||||
return CostMcoin;
|
||||
}
|
||||
|
||||
public List<ItemParamData> getCostItems() {
|
||||
return CostItems;
|
||||
}
|
||||
|
||||
public int getMinPlayerLevel() {
|
||||
return MinPlayerLevel;
|
||||
}
|
||||
|
||||
public int getMaxPlayerLevel() {
|
||||
return MaxPlayerLevel;
|
||||
}
|
||||
|
||||
public int getBuyLimit() {
|
||||
return BuyLimit;
|
||||
}
|
||||
|
||||
public int getSubTabId() {
|
||||
return SubTabId;
|
||||
}
|
||||
|
||||
public ShopInfo.ShopRefreshType getRefreshType() {
|
||||
return RefreshTypeEnum;
|
||||
}
|
||||
|
||||
public int getRefreshParam() {
|
||||
return RefreshParam;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user