예제 #1
0
        public Skill GetSkillByPetName(string name, RaceGenderClass rgc)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(null);
            }
            foreach (var rgc2 in rgc.Fallbacks())
            {
                if (!_userSkilldata.ContainsKey(rgc2))
                {
                    continue;
                }

                var skill = _userSkilldata[rgc2].FirstOrDefault(x => x.Value.Name.Contains(name)).Value;
                if (skill == null)
                {
                    skill = _userSkilldata[rgc2].FirstOrDefault(x => name.Contains(x.Value.Name)).Value; //keen hb-7
                }
                if (skill == null)
                {
                    continue;
                }
                return(skill);
            }
            return(null);
        }
예제 #2
0
        // skillIds are reused across races and class, so we need a RaceGenderClass to disambiguate them
        public Skill GetOrNull(RaceGenderClass raceGenderClass, int skillId)
        {
            foreach (var rgc2 in raceGenderClass.Fallbacks())
            {
                if (!_userSkilldata.ContainsKey(rgc2))
                {
                    continue;
                }

                UserSkill skill;
                if (!_userSkilldata[rgc2].TryGetValue(skillId, out skill))
                {
                    continue;
                }
                return(skill);
            }
            return(null);
        }