/// <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); }
/// <summary> /// Gets the list of remapping results from a plan. /// </summary> /// <param name="plan"></param> /// <returns></returns> public static List <RemappingResult> GetResultsFromRemappingPoints(BasePlan plan) { var scratchpad = new CharacterScratchpad(plan.Character.After(plan.ChosenImplantSet)); var remappingList = new List <RemappingResult>(); var list = new List <ISkillLevel>(); RemappingResult remapping = null; // Scroll through the entries and split it into remappings foreach (var entry in plan) { // Ends the current remapping and start a new one if (entry.Remapping != null) { // Creates a new remapping remapping = new RemappingResult(entry.Remapping, scratchpad.Clone()); remappingList.Add(remapping); list = remapping.Skills; } // Add this skill to the training list scratchpad.Train(entry); list.Add(entry); } // Return return(remappingList); }
/// <summary> /// Generate a trainings array from a plan /// </summary> /// <param name="plan"></param> /// <param name="bestDuration"></param> /// <returns></returns> public static List <RemappingResult> OptimizeFromPlanAndRemappingPoints(BasePlan plan) { var results = GetResultsFromRemappingPoints(plan); foreach (var result in results) { result.Optimize(TimeSpan.MaxValue); } return(results); }
/// <summary> /// Constructor /// </summary> /// <param name="owner"></param> /// <param name="skill"></param> public PlanEntry(BasePlan owner, StaticSkill skill, int level) { m_owner = owner; m_skill = skill; m_level = level; m_priority = DefaultPriority; m_notes = ""; m_oldTrainingTime = TimeSpan.Zero; m_trainingTime = TimeSpan.Zero; }
/// <summary> /// Compute the best remapping for the first year of this plan. /// </summary> /// <param name="plan"></param> /// <returns></returns> public static RemappingResult OptimizeFromFirstYearOfPlan(BasePlan plan) { var remapping = new RemappingResult(new CharacterScratchpad(plan.Character.After(plan.ChosenImplantSet))); // Scroll through the entries and split it into remappings foreach (var entry in plan) { remapping.Skills.Add(entry); } // Compute remapping.Optimize(TimeSpan.FromDays(365.0)); return(remapping); }
/// <summary> /// Creates a clone of this entry for the given plan /// </summary> /// <param name="plan"></param> /// <returns></returns> internal PlanEntry Clone(BasePlan plan) { // We need a skill for the plan's character PlanEntry clone = new PlanEntry(plan, m_skill, m_level); clone.m_entryType = m_entryType; clone.m_priority = m_priority; clone.m_notes = m_notes; clone.m_planGroups.AddRange(m_planGroups); clone.m_remapping = (m_remapping != null ? m_remapping.Clone() : null); clone.m_oldTrainingTime = m_oldTrainingTime; clone.m_trainingTime = m_trainingTime; return(clone); }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="character"></param> /// <param name="serial"></param> internal PlanEntry(BasePlan owner, SerializablePlanEntry serial) { m_owner = owner; m_entryType = serial.Type; m_skill = GetSkill(serial); m_level = serial.Level; m_notes = serial.Notes; m_priority = serial.Priority; serial.PlanGroups.ForEach(x => m_planGroups.Add(x)); if (serial.Remapping != null) { m_remapping = new RemappingPoint(serial.Remapping); } }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="character"></param> /// <param name="serial"></param> internal PlanEntry(BasePlan owner, SerializablePlanEntry serial) { m_owner = owner; m_entryType = serial.Type; m_skill = StaticSkills.GetSkillByName(serial.SkillName); m_level = serial.Level; m_notes = serial.Notes; m_priority = serial.Priority; foreach (var group in serial.PlanGroups) { m_planGroups.Add(group); } if (serial.Remapping != null) { m_remapping = new RemappingPoint(serial.Remapping); } }