Exemple #1
0
    private void Start()
    {
        alertCanvas.alpha  = instructionsCanvas.alpha = scanGifCanvas.alpha = helpCanvas.alpha = 0;
        selectedExperience = AppManager.Instance.SelectedExperience;

        setExperienceState(TapToPlace_State.SCANNING);
    }
Exemple #2
0
    private int ExperienceCount(ExperienceType experienceType)
    {
        int num = 0;

        if (experienceType == PlayerProgress.ExperienceType.UnknownSource)
        {
            return(num);
        }
        if (Singleton <GameConfigurationManager> .Instance.HasData && Singleton <GameConfigurationManager> .Instance.HasConfig("player_experience_types"))
        {
            string     key    = experienceType.ToString();
            ConfigData config = Singleton <GameConfigurationManager> .Instance.GetConfig("player_experience_types");

            int num2;
            if (config.HasKey(key) && int.TryParse(config[key], out num2))
            {
                num = num2;
            }
        }
        if (Singleton <DoubleRewardManager> .IsInstantiated() && Singleton <DoubleRewardManager> .Instance.CurrentStatus == DoubleRewardManager.Status.Initialized && Singleton <DoubleRewardManager> .Instance.HasDoubleReward)
        {
            return(num * 2);
        }
        return(num);
    }
        public static int ExperienceNeededForLevel(ExperienceType experienceType, int level)
        {
            switch (experienceType)
            {
            case ExperienceType.Erratic:
                return((int)Round(ExperienceNeededForLevelErratic(level)));

            case ExperienceType.Fast:
                return((int)Round(ExperienceNeededForLevelFast(level)));

            case ExperienceType.MediumFast:
                return((int)Round(ExperienceNeededForLevelMediumFast(level)));

            case ExperienceType.MediumSlow:
                return((int)Round(ExperienceNeededForLevelMediumSlow(level)));

            case ExperienceType.Slow:
                return((int)Round(ExperienceNeededForLevelSlow(level)));

            case ExperienceType.Fluctuating:
                return((int)Round(ExperienceNeededForLevelFluctuating(level)));

            default:
                return((int)Round(ExperienceNeededForLevelMediumFast(level)));
            }
        }
        public static int GetMaxBaseLevel(ExperienceType experienceType)
        {
            if (experienceType == ExperienceType.BASE)
            {
                return(REQUIRED_BASE_EXPERIENCE.Length);
            }

            return(Constants.MAX_CLASS_LEVEL);
        }
Exemple #5
0
    public int AddExperience(ExperienceType experienceType)
    {
        int num = 0;

        //int num = this.ExperienceCount(experienceType);
        //this.AddExperience(num);
        //this.SendFlurryExperienceGained(num, experienceType);
        return(num);
    }
    private void Awake()
    {
        selectedExperience          = AppManager.Instance.SelectedExperience;
        buttonPressed               = false;
        continueButton.interactable = false;

        Initialize();

        StartCoroutine(Loading());
    }
 public static int GetLevelForExperience(ExperienceType experienceType, int experience)
 {
     for (var i = 1; i <= Pokemon.MAX_LEVEL; i++)
     {
         var exp = GetExperienceForLevel(experienceType, i + 1);
         if (exp > experience)
         {
             return(i);
         }
     }
     return(Pokemon.MAX_LEVEL);
 }
        public static void calculateLevel(int currentLevel, int rank, long currentExperience, long totalExperienceFromCards, ExperienceType experienceType, ExperienceCardData experienceCardData)
        {
            long totalExperienceGainedFromLevels = ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, rank, currentLevel) + currentExperience;
            long finalExperienceGained = totalExperienceGainedFromLevels + totalExperienceFromCards;

            experienceCardData.PotentialLevel = calculatePotentialLevel(experienceType, currentLevel, rank, finalExperienceGained);

            experienceCardData.RemainingExperience = ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, rank, experienceCardData.PotentialLevel + 1) - finalExperienceGained;
            experienceCardData.RequiredExperience = ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, rank, experienceCardData.PotentialLevel + 1) - ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, rank, experienceCardData.PotentialLevel);
            experienceCardData.CurrentExperience = finalExperienceGained - ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, rank, experienceCardData.PotentialLevel - 1);
            experienceCardData.CurrentPercent = (experienceCardData.CurrentExperience / (float)experienceCardData.RequiredExperience) * 100;
        }
        public ActionResult Delete(Guid id, ExperienceType ExperienceType)
        {
            var experienceTypeToDelete = RepositoryFactory.ExperienceTypeRepository.GetNullableById(id);

            if (experienceTypeToDelete == null) return RedirectToAction("Index");

            RepositoryFactory.ExperienceTypeRepository.Remove(experienceTypeToDelete);

            Message = "ExperienceType Removed Successfully";

            return RedirectToAction("Index");
        }
        /// <summary>
        /// Returns the equivalent level for an experience value.
        /// </summary>
        public static int LevelForExperienceValue(ExperienceType experienceType, int experience)
        {
            // returns level 1 if no experience (or negative value):
            if (experience <= 0)
                return 1;

            int level = 1;
            while (ExperienceNeededForLevel(experienceType, level) <= experience)
                level++;

            return level;
        }
        private static int calculatePotentialLevel(ExperienceType experienceType, int currentLevel, int rank, long finalExperienceGained)
        {
            for (int potentialLevel = currentLevel; potentialLevel < ExperienceUtilityService.GetMaxBaseLevel(experienceType); potentialLevel++)
            {
                long requiredExperience = ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, potentialLevel, rank);

                if (requiredExperience > finalExperienceGained)
                {
                    return(potentialLevel);
                }
            }

            return(currentLevel);
        }
Exemple #12
0
    //[MenuItem("Window/ExperienceMachine/Asset Explorer")]
    public static void Init(ExperienceType experienceType, ResourceType resourceType, string category)
    {
        //Debug.LogError(resourceType.ToString());
        // Get existing open window or if none, make a new one:
        m_window         = (AssetExplorer)EditorWindow.GetWindow(typeof(AssetExplorer));
        m_window.minSize = new Vector2(1200, 300);
        m_resourceType   = resourceType;
        FindAssetDatabase();
        string categoryText = string.IsNullOrEmpty(category) ? " " : " " + category.ToUpper() + " ";

        m_title = experienceType.ToString().ToUpper() + categoryText + resourceType.ToString().ToUpper() + " EXPLORER";
        InitializeResources(experienceType, resourceType, category);
        m_window.Show();
    }
Exemple #13
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            ExperienceType experienceType = (ExperienceType)value;

            if ((experienceType & ExperienceType.Preview) != 0)
            {
                return("Preview");
            }
            else if ((experienceType & ExperienceType.Experimental) != 0)
            {
                return("Experimental");
            }
            return(string.Empty);
        }
        private static int calculatePotentialLevel(ExperienceType experienceType, int currentLevel, int rank, long finalExperienceGained)
        {
            for (int potentialLevel = currentLevel; potentialLevel < ExperienceUtilityService.GetMaxBaseLevel(experienceType); potentialLevel++)
            {
                long requiredExperience = ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, rank, potentialLevel);

                if (requiredExperience > finalExperienceGained)
                {
                    return potentialLevel;
                }
            }

            return currentLevel;
        }
        public ActionResult Delete(Guid id, ExperienceType ExperienceType)
        {
            var experienceTypeToDelete = RepositoryFactory.ExperienceTypeRepository.GetNullableById(id);

            if (experienceTypeToDelete == null)
            {
                return(RedirectToAction("Index"));
            }

            RepositoryFactory.ExperienceTypeRepository.Remove(experienceTypeToDelete);

            Message = "ExperienceType Removed Successfully";

            return(RedirectToAction("Index"));
        }
Exemple #16
0
 public void SetExperience(IExperience experience)
 {
     m_currentExperience = experience;
     if (m_currentExperience == m_home)
     {
         m_currentExperienceType = ExperienceType.HOME;
     }
     if (m_currentExperience == m_lobby)
     {
         m_currentExperienceType = ExperienceType.LOBBY;
     }
     if (m_currentExperience == m_meeting)
     {
         m_currentExperienceType = ExperienceType.MEETING;
     }
 }
Exemple #17
0
        public IExperience GetExperience(ExperienceType experience)
        {
            switch (experience)
            {
            case ExperienceType.HOME:
                return(m_home);

            case ExperienceType.MEETING:
                return(m_meeting);

            case ExperienceType.LOBBY:
                return(m_lobby);

            default:
                return(null);
            }
        }
        /// <summary>
        /// Returns the equivalent level for an experience value.
        /// </summary>
        public static int LevelForExperienceValue(ExperienceType experienceType, int experience)
        {
            // returns level 1 if no experience (or negative value):
            if (experience <= 0)
            {
                return(1);
            }

            int level = 1;

            while (ExperienceNeededForLevel(experienceType, level) <= experience)
            {
                level++;
            }

            return(level);
        }
        public ActionResult Create(ExperienceTypeViewModel model)
        {
            var experienceTypeToCreate = new ExperienceType();
            TransferValues(model, experienceTypeToCreate);

            if (ModelState.IsValid)
            {
                RepositoryFactory.ExperienceTypeRepository.EnsurePersistent(experienceTypeToCreate);

                Message = "ExperienceType Created Successfully";

                return RedirectToAction("Index");
            }
            else
            {
                return View(model);
            }
        }
        public static int GetExperienceForLevel(ExperienceType experienceType, int level)
        {
            switch (experienceType)
            {
            case ExperienceType.Fast:
                return((int)((4 * Pow(level, 3)) / 5));

            case ExperienceType.MediumFast:
                return((int)Pow(level, 3));

            case ExperienceType.MediumSlow:
                return((int)(1.2 * Pow(level, 3) - 15 * Pow(level, 2) + 100 * level - 140));

            case ExperienceType.Slow:
                return((int)((5 * Pow(level, 3)) / 4));
            }
            return(0);
        }
        public ActionResult Create(ExperienceTypeViewModel model)
        {
            var experienceTypeToCreate = new ExperienceType();

            TransferValues(model, experienceTypeToCreate);

            if (ModelState.IsValid)
            {
                RepositoryFactory.ExperienceTypeRepository.EnsurePersistent(experienceTypeToCreate);

                Message = "ExperienceType Created Successfully";

                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(model));
            }
        }
        // TODO: better way to determine the difference besides using an enumeration? base level doesn't need rank but class level does so it's kinda ugly/messy.
        public static int GetRequiredExperienceForLevel(ExperienceType experienceType, int rank, int level)
        {
            int requiredExperience = 0;

            switch (experienceType)
            {
            case ExperienceType.BASE:
                requiredExperience = GetRequiredBaseExperience(level);
                break;

            case ExperienceType.CLASS:
                requiredExperience = GetRequiredClassExperience(rank, level);
                break;

            default:
                break;
            }

            return(requiredExperience);
        }
 public static int ExperienceNeededForLevel(ExperienceType experienceType, int level)
 {
     switch (experienceType)
     {
         case ExperienceType.Erratic:
             return (int)Round(ExperienceNeededForLevelErratic(level));
         case ExperienceType.Fast:
             return (int)Round(ExperienceNeededForLevelFast(level));
         case ExperienceType.MediumFast:
             return (int)Round(ExperienceNeededForLevelMediumFast(level));
         case ExperienceType.MediumSlow:
             return (int)Round(ExperienceNeededForLevelMediumSlow(level));
         case ExperienceType.Slow:
             return (int)Round(ExperienceNeededForLevelSlow(level));
         case ExperienceType.Fluctuating:
             return (int)Round(ExperienceNeededForLevelFluctuating(level));
         default:
             return (int)Round(ExperienceNeededForLevelMediumFast(level));
     }
 }
Exemple #24
0
 public static void AddPendingExperience(Dictionary <ExperienceType, int> experiences)
 {
     if (PlayerProgress.pendingExperienceTypes == null)
     {
         PlayerProgress.pendingExperienceTypes = new Dictionary <ExperienceType, int>();
     }
     foreach (KeyValuePair <ExperienceType, int> keyValuePair in experiences)
     {
         if (keyValuePair.Value > 0)
         {
             if (PlayerProgress.pendingExperienceTypes.ContainsKey(keyValuePair.Key))
             {
                 Dictionary <ExperienceType, int> dictionary = PlayerProgress.pendingExperienceTypes;
                 ExperienceType key = keyValuePair.Key;
                 dictionary[key] = dictionary[key] + keyValuePair.Value;
             }
             else
             {
                 PlayerProgress.pendingExperienceTypes.Add(keyValuePair.Key, keyValuePair.Value);
             }
         }
     }
 }
Exemple #25
0
 private void SendFlurryExperienceGained(int amount, ExperienceType typeOfGain)
 {
 }
 private void Awake()
 {
     selectedExperience = AppManager.Instance.SelectedExperience;
 }
Exemple #27
0
 public Player079AddExpEvent(Player player, ExperienceType experienceType, float expToAdd) : base(player)
 {
     ExperienceType = experienceType;
     ExpToAdd       = expToAdd;
 }
Exemple #28
0
    void Awake()
    {
        selectedExperience = AppManager.Instance.SelectedExperience;

        Initialize();
    }
        public static int GetMaxBaseLevel(ExperienceType experienceType)
        {
            if(experienceType == ExperienceType.BASE)
            {
                return REQUIRED_BASE_EXPERIENCE.Length;
            }

            return Constants.MAX_CLASS_LEVEL;
        }
 /// <summary>
 /// Transfer editable values from source to destination
 /// </summary>
 private static void TransferValues(ExperienceTypeViewModel source, ExperienceType destination)
 {
     destination.Name = source.Name;
     destination.Icon = source.Icon;
 }
Exemple #31
0
 public ExperienceInfo(ExperienceType type)
     : this(type, null, null)
 {
 }
Exemple #32
0
    private static void InitializeResources(ExperienceType experienceType, ResourceType resourceType, string category)
    {
        m_resources = null;
        switch (experienceType)
        {
        case ExperienceType.NATURE:
            if (resourceType == ResourceType.LOCATION)
            {
                ExperienceGroup group = Array.Find(m_assetDb.NatureLocationsGroups, item => item.Name == category);
                if (group != null)
                {
                    m_resources = group.Resources;
                }
            }

            if (resourceType == ResourceType.MUSIC)
            {
                AudioGroup group = Array.Find(m_assetDb.NatureMusic, item => item.Name == category);
                if (group != null)
                {
                    m_resources = group.Resources;
                }
            }
            break;

        case ExperienceType.MANDALA:
            if (resourceType == ResourceType.COLOR)
            {
                ColorGroup group = Array.Find(m_assetDb.ColorGroups, item => item.Name == category);
                if (group != null)
                {
                    m_resources = group.Resources;
                }
            }

            if (resourceType == ResourceType.MUSIC)
            {
                AudioGroup group = Array.Find(m_assetDb.MandalaMusic, item => item.Name == category);
                if (group != null)
                {
                    m_resources = group.Resources;
                }
            }
            break;

        case ExperienceType.ABSTRACT:
            if (resourceType == ResourceType.LOCATION)
            {
                ExperienceGroup group = Array.Find(m_assetDb.AbstractLocationsGroups, item => item.Name == category);
                if (group != null)
                {
                    m_resources = group.Resources;
                }
            }

            if (resourceType == ResourceType.MUSIC)
            {
                AudioGroup group = Array.Find(m_assetDb.AbstractMusic, item => item.Name == category);
                if (group != null)
                {
                    m_resources = group.Resources;
                }
            }
            break;

        case ExperienceType.GLOBAL:
            if (resourceType == ResourceType.GUIDE_AUDIO)
            {
                GuideAudioGroup group = Array.Find(m_assetDb.GuideAudioGroups, item => item.Name == category);
                if (group != null)
                {
                    m_resources = group.Resources;
                }
            }

            if (resourceType == ResourceType.AUDIO)
            {
                AudioGroup group = Array.Find(m_assetDb.AudioGroups, item => item.Name == category);
                if (group != null)
                {
                    m_resources = group.Resources;
                }
            }

            if (resourceType == ResourceType.OBJECT)
            {
                ObjectGroup group = Array.Find(m_assetDb.ObjectGroups, item => item.Name == category);
                if (group != null)
                {
                    m_resources = group.Resources;
                }
            }
            break;

        default:
            break;
        }

        if (m_resources == null)
        {
            return;
        }

        m_name        = new string[m_resources.Length];
        m_color       = new Color[m_resources.Length];
        m_description = new string[m_resources.Length];
        m_sprite      = new Sprite[m_resources.Length];
        m_clip        = new AudioClip[m_resources.Length];
    }
Exemple #33
0
 public ExperienceInfo(ExperienceType type, Vector3?position)
     : this(type, position, null)
 {
 }
Exemple #34
0
        private static void PopulateDb(FluentConfiguration config)
        {
            using (var session = config.BuildSessionFactory().OpenSession())
            {
                using (var tx = session.BeginTransaction())
                {
                    PopulateLookups(session);

                    var studentRole = new Role(RoleNames.Student) {Name = "Student"};
                    var instructorRole = new Role(RoleNames.Instructor) {Name = "Instructor"};
                    var adminRole = new Role(RoleNames.Administrator) {Name = "Administrator"};
                    session.SaveOrUpdate(studentRole);
                    session.SaveOrUpdate(instructorRole);
                    session.SaveOrUpdate(adminRole);

                    var user = new User {Identifier = "postit"};
                    user.Profile = new Profile(user)
                        {
                            FirstName = "Scott",
                            LastName = "Kirkland",
                            Email = "*****@*****.**",
                            ImageUrl = WebConfigurationManager.AppSettings["DefaultProfilePictureUrl"]
                        };
                    user.Roles.Add(studentRole);

                    session.SaveOrUpdate(user);

                    var hermes = new User {Identifier = "hconrad"};
                    hermes.AssociateProfile(new Profile(hermes)
                        {
                            FirstName = "Hermes",
                            LastName = "Conrad",
                            Email = "*****@*****.**",
                            ImageUrl = WebConfigurationManager.AppSettings["DefaultProfilePictureUrl"]
                        });
                    hermes.Roles.Add(instructorRole);

                    session.SaveOrUpdate(hermes);

                    var farnsworth = new User { Identifier = "hfarnsworth" };
                    farnsworth.AssociateProfile(new Profile(farnsworth)
                    {
                        FirstName = "Hubert",
                        LastName = "Farnsworth",
                        Email = "*****@*****.**",
                        ImageUrl = WebConfigurationManager.AppSettings["DefaultProfilePictureUrl"]
                    });

                    session.SaveOrUpdate(farnsworth);

                    var instructor = new Instructor
                        {
                            FirstName = "Hubert",
                            LastName = "Farnsworth",
                            Email = "*****@*****.**",
                            Identifier = "hfarnworth",
                            User = farnsworth
                        };

                    var instructor2 = new Instructor
                    {
                        FirstName = "Hermes",
                        LastName = "Conrad",
                        Email = "*****@*****.**",
                        Identifier = "hconrad",
                        User = hermes
                    };

                    session.SaveOrUpdate(instructor);
                    session.SaveOrUpdate(instructor2);

                    var etype = new ExperienceType { Name = "Exploration", Icon = "icon-flag" };
                    session.SaveOrUpdate(etype);
                    session.SaveOrUpdate(new ExperienceType {Name = "Collaboration", Icon = "icon-group"});

                    var outcome = new Outcome {Name = "Outcome 1", Description = "Some outcome", ImageUrl = string.Empty};
                    session.SaveOrUpdate(outcome);
                    session.SaveOrUpdate(new Outcome
                        {
                            Name = "Super Skills",
                            Description = "Pretty good skillz",
                            ImageUrl = string.Empty
                        });

                    var experience = new Experience
                        {
                            Creator = user,
                            ExperienceType = etype,
                            Name = "Sample Experience",
                            Description = "This is a bit of text about exactly what I did in this experience",
                            Start = DateTime.Now,
                            Location = "moab, ut",
                            CoverImageUrl = "https://ucdbadges.blob.core.windows.net/publicimagesdev/e600f3de-a969-45af-b70b-7d2f5285e572"
                        };

                    experience.AddInstructor(instructor);
                    experience.AddInstructor(instructor2);

                    session.SaveOrUpdate(experience);

                    //Badges
                    var category = new BadgeCategory
                        {
                            Name = "SampleCategory",
                            ImageUrl = "https://ucdbadges.blob.core.windows.net/publicimagesdev/12da4d70-207a-45e5-b6e4-f1b418c1802a"
                        };

                    session.SaveOrUpdate(category);

                    var badge = new Badge
                        {
                            Approved = true,
                            Category = category,
                            CreatedOn = DateTime.UtcNow,
                            Name = "First Badge",
                            Description = "Really interesting badge for being awesome",
                            Creator = user,
                            ImageUrl = "https://ucdbadges.blob.core.windows.net/publicimagesdev/12da4d70-207a-45e5-b6e4-f1b418c1802a"
                        };

                    badge.AddCriteria("You need to do a, b, c");
                    badge.AddCriteria("Also you need to be a human");

                    session.SaveOrUpdate(badge);

                    tx.Commit();
                }

            }
        }
Exemple #35
0
 public ExperienceInfo(ExperienceType type, uint?multipleEvent)
     : this(type, null, multipleEvent)
 {
 }
Exemple #36
0
 public Experience(long amount, ExperienceType type)
 {
     Amount = amount;
     Type   = type;
 }
Exemple #37
0
 public ExperienceInfo(ExperienceType type, Vector3?position, uint?multipleEvent)
 {
     mType          = type;
     mPosition      = position;
     mMultipleEvent = multipleEvent;
 }
        // TODO: better way to determine the difference besides using an enumeration? base level doesn't need rank but class level does so it's kinda ugly/messy.
        public static int GetRequiredExperienceForLevel(ExperienceType experienceType, int rank, int level)
        {
            int requiredExperience = 0;

            switch(experienceType)
            {
                case ExperienceType.BASE:
                    requiredExperience = GetRequiredBaseExperience(level);
                    break;

                case ExperienceType.CLASS:
                    requiredExperience = GetRequiredClassExperience(rank, level);
                    break;

                default:
                    break;
            }

            return requiredExperience;
        }
Exemple #39
0
    // Update is called once per frame
    void Update()
    {
        Timer += Time.deltaTime;

        if (Timer <= 6.0f)
        {
            transform.position = ogspot.position;
        }
        if (Timer > 6.0f && Timer < 13.0f)
        {
            var TargetRot = Quaternion.LookRotation(target.position - transform.position);

            transform.rotation = Quaternion.Slerp(transform.rotation, TargetRot, 0.0075f);
            transform.position = newPos.position;
        }

        if (Timer > 12.0f)
        {
            Overlay.color = Color.Lerp(Overlay.color, new Color(0, 0, 0, 1), 0.05f);
        }
        if (Timer > 15.5f)
        {
            Oppy1.SetActive(true);
            Persy1.SetActive(true);
        }

        if (Timer > 16.0f && Timer < 20.0f)
        {
            transform.position = Spot1.position;
            transform.rotation = Spot1.rotation;
            Overlay.color      = new Color(0, 0, 0, 0);
            Overlay.gameObject.SetActive(false);
        }

        if (Timer >= 20.0f && Timer < 23.0f)
        {
            Spot1.parent = null;
        }

        if (Timer >= 23.0f)
        {
            var TargetRot = Quaternion.LookRotation(target2.position - transform.position);

            transform.rotation = Quaternion.Slerp(transform.rotation, TargetRot, 0.0075f);
        }

        if (Timer > 27.0f)
        {
            Overlay.gameObject.SetActive(true);
            Overlay.color = Color.Lerp(Overlay.color, new Color(0, 0, 0, 1), 0.1f);
        }

        if (Timer > 28.5f)
        {
            Credits.gameObject.SetActive(true);
        }


        if (Timer > 31.0f)
        {
            SceneManager.LoadScene("MainMenu");
            ExperienceType Experience = FindObjectOfType <ExperienceType>();
            Experience.Interactive = false;
            Experience.Cinematic   = false;
        }
    }
        public static void calculateLevel(int currentLevel, int rank, long currentExperience, long totalExperienceFromCards, ExperienceType experienceType, ExperienceCardData experienceCardData)
        {
            long totalExperienceGainedFromLevels = ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, currentLevel, rank) + currentExperience;
            long finalExperienceGained           = totalExperienceGainedFromLevels + totalExperienceFromCards;

            experienceCardData.PotentialLevel = calculatePotentialLevel(experienceType, currentLevel, rank, finalExperienceGained);

            experienceCardData.RemainingExperience = ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, experienceCardData.PotentialLevel + 1, rank) - finalExperienceGained;
            experienceCardData.RequiredExperience  = ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, experienceCardData.PotentialLevel + 1, rank) - ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, experienceCardData.PotentialLevel, rank);
            experienceCardData.CurrentExperience   = finalExperienceGained - ExperienceUtilityService.GetRequiredExperienceForLevel(experienceType, experienceCardData.PotentialLevel - 1, rank);
            experienceCardData.CurrentPercent      = (experienceCardData.CurrentExperience / (float)experienceCardData.RequiredExperience) * 100;
        }
Exemple #41
0
        private IEnumerable<Candidate> GetCandidatesByExperience(IEnumerable<Candidate> candidates, ExperienceType type)
        {
            var searchQuery = (type == ExperienceType.Work) ? Advanced.SearchWork : Advanced.SearchSkills;

            if (string.IsNullOrEmpty(searchQuery))
                return candidates;

            var temporaryCollection = (candidates == null) ? Get : candidates;
            return temporaryCollection.Where(
                c => c.Experience().Any(
                    e => e.TypeId == type
                        && e.Name.ParseText(searchQuery)
                        ));
        }