| | |
| | | private static Dictionary<StoreItem, StoreConfig> s_StoreItemDict = new Dictionary<StoreItem, StoreConfig>();
|
| | | private static Dictionary<int, List<StoreConfig>> storeConfigs = new Dictionary<int, List<StoreConfig>>();
|
| | |
|
| | | static readonly int[] shop1Types = new int[] { 2, 3 };
|
| | | static readonly int[] shop2Types = new int[] { 4 };
|
| | | static readonly int[] shop1Types = new int[] { 1, 2, 3 };
|
| | | public void OnConfigParseCompleted()
|
| | | {
|
| | | if (ShopType == 0) return;
|
| | |
| | | item = _item,
|
| | | type = _moneyType,
|
| | | shopType = shop1Types[i],
|
| | | };
|
| | | if (s_StoreItemDict.ContainsKey(storeItem))
|
| | | {
|
| | | return s_StoreItemDict[storeItem];
|
| | | }
|
| | | }
|
| | | }
|
| | | break;
|
| | | case 2:
|
| | | {
|
| | | for (int i = 0; i < shop2Types.Length; i++)
|
| | | {
|
| | | var storeItem = new StoreItem()
|
| | | {
|
| | | item = _item,
|
| | | type = _moneyType,
|
| | | shopType = shop2Types[i],
|
| | | };
|
| | | if (s_StoreItemDict.ContainsKey(storeItem))
|
| | | {
|
| | |
| | | _dict = new Dictionary<int, StoreConfig>();
|
| | | liquidStoreDict.Add(liquidItems[i], _dict);
|
| | | }
|
| | | for (int k = 0; k < _moneyTypeList.Count; k++)
|
| | | for (int j = 0; j < _shopTypes.Count; j++)
|
| | | {
|
| | | var config = StoreConfig.GetStoreCfg(liquidItems[i], _moneyTypeList[k]);
|
| | | if (config != null && _shopTypes.Contains(config.ShopType))
|
| | | for (int k = 0; k < _moneyTypeList.Count; k++)
|
| | | {
|
| | | _dict.Add(_moneyTypeList[k], config);
|
| | | var config = StoreConfig.GetStoreCfg(liquidItems[i], _moneyTypeList[k], _shopTypes[j]);
|
| | | if (config != null)
|
| | | {
|
| | | if (!_dict.ContainsKey(_moneyTypeList[k]))
|
| | | {
|
| | | _dict.Add(_moneyTypeList[k], config);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|