/// <summary> /// Updates the statistics of the entries in the same way the given character would train this plan. /// </summary> /// <param name="scratchpad"></param> /// <param name="applyRemappingPoints"></param> /// <param name="trainSkills">When true, the character will train every skill, increasing SP, etc.</param> public void UpdateStatistics(CharacterScratchpad scratchpad, bool applyRemappingPoints, bool trainSkills) { var scratchpadWithoutImplants = scratchpad.Clone(); scratchpadWithoutImplants.ClearImplants(); DateTime time = DateTime.Now; // Update the statistics foreach (var entry in m_items) { // Apply the remapping if (applyRemappingPoints && entry.Remapping != null && entry.Remapping.Status == RemappingPoint.PointStatus.UpToDate) { scratchpad.Remap(entry.Remapping); scratchpadWithoutImplants.Remap(entry.Remapping); } // Update entry's statistics entry.UpdateStatistics(scratchpad, scratchpadWithoutImplants, ref time); // Update the scratchpad if (trainSkills) { scratchpad.Train(entry.Skill, entry.Level); scratchpadWithoutImplants.Train(entry.Skill, entry.Level); } } }
/// <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); 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); }