| | |
| | | return validDatas; |
| | | } |
| | | |
| | | public List<StoreData> GetTimeValidHeroSkinStoreDatas() |
| | | { |
| | | var validDatas = GetTimeValidStoreDatas(StoreFunc.HeroSkin); |
| | | if (validDatas == null) |
| | | return null; |
| | | |
| | | List<StoreData> heroSkinValidDatas = new List<StoreData>(); |
| | | for (int i = 0; i < validDatas.Count; i++) |
| | | { |
| | | var storeData = validDatas[i]; |
| | | if (IsHeroSkinShopOpenByStoreConfig(storeData.storeConfig)) |
| | | { |
| | | heroSkinValidDatas.Add(storeData); |
| | | } |
| | | } |
| | | |
| | | return heroSkinValidDatas; |
| | | } |
| | | |
| | | public bool IsHeroSkinShopOpenByShopID(int shopID) |
| | | { |
| | | return IsHeroSkinShopOpenByStoreConfig(StoreConfig.Get(shopID)); |
| | | } |
| | | |
| | | public bool IsHeroSkinShopOpenByStoreConfig(StoreConfig storeConfig) |
| | | { |
| | | if (!TryGetHeroSkinShopSkinID(storeConfig, out var skinID)) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | return IsHeroSkinShopOpenBySkinID(skinID); |
| | | } |
| | | |
| | | public bool IsHeroSkinShopOpenBySkinID(int skinID) |
| | | { |
| | | var skinConfig = HeroSkinConfig.Get(skinID); |
| | | if (skinConfig == null || skinConfig.OpenDay <= 0) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | return TimeUtility.OpenDay + 1 >= skinConfig.OpenDay; |
| | | } |
| | | |
| | | public bool TryGetHeroSkinShopSkinID(StoreConfig storeConfig, out int skinID) |
| | | { |
| | | skinID = 0; |
| | | if (storeConfig == null) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (HeroSkinAttrConfig.TryGetSkinIDByItemID(storeConfig.ItemID, out skinID)) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | if (storeConfig.ItemListEx == null) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | for (int i = 0; i < storeConfig.ItemListEx.Length; i++) |
| | | { |
| | | var item = storeConfig.ItemListEx[i]; |
| | | if (item != null && item.Length > 0 && HeroSkinAttrConfig.TryGetSkinIDByItemID(item[0], out skinID)) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | public bool TryGetTimeValidSkinShopIDByItemID(int itemID, out int shopID) |
| | | { |
| | | shopID = 0; |
| | | var validDatas = GetTimeValidStoreDatas(StoreFunc.HeroSkin); |
| | | var validDatas = GetTimeValidHeroSkinStoreDatas(); |
| | | if (validDatas == null) |
| | | { |
| | | return false; |