/// <summary> /// Reset to original optimized remapping. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonOptimize_Click(object sender, EventArgs e) { // Updates the remapping point with the optimized remapping m_remapping.Update(); // Set all labels and bars to calculated optimized remap UpdateControls(m_character, m_plan, m_remapping, m_description); // Fires the event AttributeChanged?.ThreadSafeInvoke(this, new AttributeChangedEventArgs(m_remapping)); }
/// <summary> /// Reset to remapping with current attributes. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonCurrent_Click(object sender, EventArgs e) { // Make unoptimized remap RemappingResult zeroRemapping = new RemappingResult(m_remapping, m_remapping.BaseScratchpad.Clone()); zeroRemapping.Update(); // Update the controls UpdateControls(m_character, m_plan, zeroRemapping, m_description); // Fires the event AttributeChanged?.ThreadSafeInvoke(this, new AttributeChangedEventArgs(zeroRemapping)); }
/// <summary> /// Calculates new remapping from values of controls. /// </summary> private void Recalculate() { CharacterScratchpad scratchpad = m_remapping.BaseScratchpad.Clone(); scratchpad.Memory.Base = pbMEMRemappable.Value + EveConstants.CharacterBaseAttributePoints; scratchpad.Charisma.Base = pbCHARemappable.Value + EveConstants.CharacterBaseAttributePoints; scratchpad.Willpower.Base = pbWILRemappable.Value + EveConstants.CharacterBaseAttributePoints; scratchpad.Perception.Base = pbPERRemappable.Value + EveConstants.CharacterBaseAttributePoints; scratchpad.Intelligence.Base = pbINTRemappable.Value + EveConstants.CharacterBaseAttributePoints; // Get remapping for provided attributes RemappingResult manualRemapping = new RemappingResult(m_remapping, scratchpad); manualRemapping.Update(); UpdateControls(m_character, m_plan, manualRemapping, m_description); // Notify the changes AttributeChanged?.ThreadSafeInvoke(this, new AttributeChangedEventArgs(manualRemapping)); }
/// <summary> /// Updates the controls with the values from the current remapping point. /// </summary> /// <param name="point"></param> /// <exception cref="System.ArgumentNullException">point</exception> public void UpdateValuesFrom(RemappingPoint point) { point.ThrowIfNull(nameof(point)); // Creates a scratchpad with the base values from the provided point. CharacterScratchpad scratchpad = new CharacterScratchpad(m_character.After(m_plan.ChosenImplantSet)); for (int i = 0; i < 5; i++) { scratchpad[(EveAttribute)i].Base = point[(EveAttribute)i]; } RemappingResult remapping = new RemappingResult(m_remapping, scratchpad); remapping.Update(); // Update the controls UpdateControls(m_character, m_plan, remapping, m_description); // Fires the event AttributeChanged?.ThreadSafeInvoke(this, new AttributeChangedEventArgs(remapping)); }