少年修仙传客户端代码仓库
client_Wu Xijin
2019-02-21 d7265aed55e1a291b75c07fed91a00e8de2590d5
3335 物品相关类型重构
1个文件已删除
1 文件已重命名
1个文件已添加
1个文件已修改
142 ■■■■■ 已修改文件
System/KnapSack/Logic/ItemLegendPropertyUtility.cs 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/ItemLegendPropertyUtility.cs.meta 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/ItemPropertyPreviewUtility.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/ItemTipsModel.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/ItemLegendPropertyUtility.cs
New file
@@ -0,0 +1,127 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LitJson;
public class ItemLegendPropertyUtility
{
    public Dictionary<string, Dictionary<LegendAttrType, int>> legendAttrCntPreviewDict { get; private set; } // key 品质+星级  value 属性条目数
    public Dictionary<int, Dictionary<LegendAttrType, List<int>>> legendAttrIDPreviewDict { get; private set; } // key 装备位 value 属性类型,属性ID
    public Dictionary<int, Dictionary<int, int>> legendAttrColorValuePreviewDict { get; private set; } // key 属性ID value 装备品质,属性数值
    public Dictionary<int, Dictionary<int, int>> legendAttrLvValuePreviewDict { get; private set; } // key 属性ID value 装备阶级,属性数值
    public Dictionary<int, int> wingsLegendAttrCntPreviewDict { get; private set; } //key 阶数 value属性数
    public Dictionary<int, Dictionary<int, List<int>>> wingsLegendAttrValuePreviewDict { get; private set; } //key 阶数 value 属性ID 属性数值
    public Dictionary<int, Dictionary<LegendAttrType, List<int>>> dogzLegendAttrIDPreviewDict { get; private set; } // key 装备位 value 属性类型,属性ID
    public Dictionary<int, Dictionary<int, int>> dogzLegendAttrColorValuePreviewDict { get; private set; } // key 属性ID value 装备品质,属性数值
    Dictionary<string, Dictionary<LegendAttrType, int>> dogzLegendAttrCntPreviewDict { get; set; } // key 品质+星级  value 属性条目数
    Dictionary<int, List<int>> dogzLegendAttrTypeDict { get; set; }
    public static void Init()
    {
    }
    public class LegendPropertyColor
    {
        Dictionary<int, LegendAttrType> equipLegendPropertyColors = new Dictionary<int, LegendAttrType>();
        Dictionary<int, Dictionary<int, string>> wingLegendPropertyColors = new Dictionary<int, Dictionary<int, string>>();
        public LegendPropertyColor(string configId)
        {
            var config = FuncConfigConfig.Get(configId);
            var equipColorJsonData = JsonMapper.ToObject(config.Numerical1);
            foreach (var key in equipColorJsonData.Keys)
            {
                var keyToInt = int.Parse(key);
                for (int i = 0; i < equipColorJsonData[key].Count; i++)
                {
                    var propertyId = (int)equipColorJsonData[key][i];
                    equipLegendPropertyColors[propertyId] = (LegendAttrType)keyToInt;
                }
            }
            var wingColorJsonData = JsonMapper.ToObject(config.Numerical2);
            foreach (var key in wingColorJsonData.Keys)
            {
                var propertyId = int.Parse(key);
                if (!wingLegendPropertyColors.ContainsKey(propertyId))
                {
                    wingLegendPropertyColors[propertyId] = new Dictionary<int, string>();
                }
                var subJson = wingColorJsonData[key];
                var colors = wingLegendPropertyColors[propertyId];
                foreach (var key2 in subJson.Keys)
                {
                    var limit = int.Parse(key2);
                    colors[limit] = subJson[key2][0].ToString();
                }
            }
        }
        public LegendAttrType GetPropertyType(int propertyId)
        {
            if (equipLegendPropertyColors.ContainsKey(propertyId))
            {
                return equipLegendPropertyColors[propertyId];
            }
            else
            {
                return LegendAttrType.Normal;
            }
        }
        public string GetWingPropertyColor(int propertyId, int value)
        {
            if (!wingLegendPropertyColors.ContainsKey(propertyId))
            {
                return "ffffff";
            }
            var colors = wingLegendPropertyColors[propertyId];
            var ienumerator = colors.GetEnumerator();
            var color = ienumerator.Current.Value;
            while (ienumerator.MoveNext())
            {
                if (value < ienumerator.Current.Key)
                {
                    color = ienumerator.Current.Value;
                }
                else
                {
                    break;
                }
            }
            return color;
        }
    }
    public class LegendPropertyCount
    {
        Dictionary<>
        class StarLegendPropertyCount
        {
            Dictionary<LegendAttrType, int> counts = new Dictionary<LegendAttrType, int>();
            public StarLegendPropertyCount(JsonData json)
            {
            }
        }
    }
}
System/KnapSack/Logic/ItemLegendPropertyUtility.cs.meta
System/KnapSack/Logic/ItemPropertyPreviewUtility.cs
File was deleted
System/KnapSack/Logic/ItemTipsModel.cs
@@ -29,6 +29,7 @@
        public Dictionary<int, Dictionary<int, int>> dogzLegendAttrColorValuePreviewDict { get; private set; } // key 属性ID value 装备品质,属性数值
        Dictionary<string, Dictionary<LegendAttrType, int>> dogzLegendAttrCntPreviewDict { get; set; } // key 品质+星级  value 属性条目数
        Dictionary<int, List<int>> dogzLegendAttrTypeDict { get; set; }
        public Dictionary<int, List<string>> guardDesDict { get; private set; }
        public Dictionary<int, PetInfoConfig> unlockPetDict { get; private set; }