少年修仙传客户端代码仓库
client_Wu Xijin
2019-06-13 033958214c0b16d7e7b93cc821b018c295251867
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace Snxxz.UI
{
    public class CalculateSkillGetAttrHurtUtility : Singleton<CalculateSkillGetAttrHurtUtility>
    {
        PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
        private Dictionary<int, int> legendAttrDict = new Dictionary<int, int>();
 
        public CalculateSkillGetAttrHurtUtility()
        {
            playerPack.refreshItemCountEvent += UpdateItem;
            UpdateSkillHurt();
        }
 
        private void UpdateItem(PackType type, int index, int id)
        {
        }
 
        private void UpdateSkillHurt()
        {
            return;
        }
 
        public bool TryGetAttrDictBySkill(int _skillId,out Dictionary<int,int> attrDict)
        {
            attrDict = new Dictionary<int, int>();
            var attrIds = GeneralDefine.GetAttrIdsBySkill(_skillId);
            if(attrIds != null)
            {
                foreach(var attrId in attrIds)
                {
                    if(legendAttrDict.ContainsKey(attrId))
                    {
                        int attrValue = legendAttrDict[attrId];
                        attrDict.Add(attrId,attrValue);
                    }
                }
            }
            return attrDict.Count > 0;
        }
    }
}