Esempio n. 1
0
        /// <summary>
        /// Generate a trainings array from the skills already know by a character.
        /// </summary>
        /// <param name="character">The character.</param>
        /// <param name="plan">The plan.</param>
        /// <returns></returns>
        public static RemappingResult OptimizeFromCharacter(Character character, BasePlan plan)
        {
            // Create a character without any skill
            var scratchpad = new CharacterScratchpad(character.After(plan.ChosenImplantSet));

            scratchpad.ClearSkills();

            // Create a new plan
            var newPlan = new Plan(scratchpad);

            // Add all trained skill levels that the character has trained so far
            foreach (var skill in character.Skills)
            {
                newPlan.PlanTo(skill, skill.Level);
            }

            // Create a new remapping
            var remapping = new RemappingResult(scratchpad);

            // Add those skills to the remapping
            foreach (var entry in newPlan)
            {
                remapping.Skills.Add(entry);
            }

            // Optimize
            remapping.Optimize(TimeSpan.MaxValue);
            return(remapping);
        }
Esempio n. 2
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);
        }