Example #1
0
        /// <summary>
        /// Generate a trainings array from the skills already know by a character
        /// </summary>
        /// <param name="character"></param>
        /// <returns></returns>
        public static RemappingResult OptimizeFromCharacter(Character character)
        {
            // Create a character without any skill
            var scratchpad = new CharacterScratchpad(character);

            scratchpad.ClearSkills();

            // Create a sorted plan for the learning skills
            var plan = new Plan(scratchpad);

            foreach (var learning in character.SkillGroups["Learning"])
            {
                plan.PlanTo(learning, learning.Level);
            }
            plan.SortLearningSkills(false);

            // Add the non-training skills after that
            foreach (var skill in character.Skills)
            {
                if (skill.Group.Name != "Learning")
                {
                    plan.PlanTo(skill, skill.Level);
                }
            }

            // Add those learning skills to a list
            var remapping = new RemappingResult(scratchpad);

            foreach (var entry in plan)
            {
                remapping.Skills.Add(entry);
            }

            // Optimize
            remapping.Optimize(TimeSpan.FromDays(365.0));
            return(remapping);
        }
Example #2
0
 /// <summary>
 /// Apply the suggestions to the plan
 /// </summary>
 public void ApplySuggestions()
 {
     m_originalPlan.TryAddSet(m_items, "Suggestions").PerformAddition(1);
     m_originalPlan.SortLearningSkills(false);
 }