|
@@ -5,13 +5,14 @@ namespace GFGGame
|
|
|
public class DecomposeDataManager : SingletonBase<DecomposeDataManager>
|
|
|
{
|
|
|
Dictionary<int, List<int>> _decomposeData = new Dictionary<int, List<int>>();//所有数量大于1的换装部件数据
|
|
|
- Dictionary<int, List<int>> _suitSyntheticMaterias = new Dictionary<int, List<int>>();//suitId,materiasId
|
|
|
+ Dictionary<int, List<int>> _suitSyntheticMaterials = new Dictionary<int, List<int>>();//materiasId,Lsit<suitId>
|
|
|
List<int> _rewardList = new List<int>();
|
|
|
|
|
|
public const int MaxCount = 999;
|
|
|
public void Clear()
|
|
|
{
|
|
|
_decomposeData.Clear();
|
|
|
+ _suitSyntheticMaterials.Clear();
|
|
|
}
|
|
|
public void Add(int itemId)
|
|
|
{
|
|
@@ -74,15 +75,39 @@ namespace GFGGame
|
|
|
suitCfgs.AddRange(new List<SuitCfg>(SuitCfgArray.Instance.GetCfgsBysyntheticType(1)));
|
|
|
suitCfgs.AddRange(new List<SuitCfg>(SuitCfgArray.Instance.GetCfgsBysyntheticType(2)));
|
|
|
suitCfgs.AddRange(new List<SuitCfg>(SuitCfgArray.Instance.GetCfgsBysyntheticType(3)));
|
|
|
+
|
|
|
for (int i = 0; i < suitCfgs.Count; i++)
|
|
|
{
|
|
|
+ int suitId = suitCfgs[i].id;
|
|
|
+ for (int j = 0; j < suitCfgs[i].partsArr.Length; j++)
|
|
|
+ {
|
|
|
+ ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(suitCfgs[i].partsArr[j]);
|
|
|
|
|
|
+ for (int k = 0; k < itemCfg.syntheticMateriarsArr.Length; k++)
|
|
|
+ {
|
|
|
+ int materialId = itemCfg.syntheticMateriarsArr[k][0];
|
|
|
+ if (!_suitSyntheticMaterials.ContainsKey(materialId))
|
|
|
+ {
|
|
|
+ _suitSyntheticMaterials[materialId] = new List<int>();
|
|
|
+ }
|
|
|
+ if (_suitSyntheticMaterials[materialId].IndexOf(suitId) < 0) _suitSyntheticMaterials[materialId].Add(suitId);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- public bool CheckIsSyntheticMaterias()
|
|
|
+ /// <summary>
|
|
|
+ /// 检测物品对应的套装是否全部合成
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="itemId"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public bool CheckIsItemForSuitSynthetic(int itemId)
|
|
|
{
|
|
|
-
|
|
|
- return false;
|
|
|
+ if (!_suitSyntheticMaterials.ContainsKey(itemId)) return true;
|
|
|
+ for (int i = 0; i < _suitSyntheticMaterials[itemId].Count; i++)
|
|
|
+ {
|
|
|
+ if (!DressUpMenuSuitDataManager.CheckHaveSuit(_suitSyntheticMaterials[itemId][i])) return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|
|
|
}
|