Esempio n. 1
0
 public int GetSkillMastery(long skillID)
 {
     if (!Learned.Any(x => x.Item1 == skillID))
     {
         return(0);
     }
     return(Learned.First(x => x.Item1 == skillID).Item2);
 }
Esempio n. 2
0
        public void UpdateSkillMastery(long skillID, int value, bool additive = false)
        {
            int newValue = value;

            if (Learned.Any(x => x.Item1 == skillID))
            {
                if (additive)
                {
                    var learned = Learned.First(x => x.Item1 == skillID);
                    newValue += learned.Item2;
                }

                Learned.Remove(Learned.First(x => x.Item1 == skillID));
            }

            Learned.Add(new Tuple <long, int>(skillID, newValue));
        }