Exemplo n.º 1
0
        private int CalculateLevel()
        {
            if (experience == null)
            {
                return(startingLevel);
            }

            float currentXP        = experience.GetExperienceValue();
            int   penultimateLevel = progression.GetLevels(Stat.ExperienceToLevelUp, characterClass);

            for (int level = 1; level <= penultimateLevel; level++)
            {
                float xpToLevelUp = progression.GetStat(Stat.ExperienceToLevelUp, characterClass, level);
                if (xpToLevelUp > currentXP)
                {
                    return(level);
                }
            }
            return(penultimateLevel + 1);
        }
Exemplo n.º 2
0
 private void DisplayExperienceValue()
 {
     xpText.SetText(String.Format("{0:0}", experience.GetExperienceValue()));
 }