/// <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> /// <exception cref="System.ArgumentNullException">character or plan</exception> public static RemappingResult OptimizeFromCharacter(Character character, BasePlan plan) { character.ThrowIfNull(nameof(character)); plan.ThrowIfNull(nameof(plan)); // Create a character without any skill CharacterScratchpad scratchpad = new CharacterScratchpad(character.After(plan.ChosenImplantSet)); scratchpad.ClearSkills(); // Create a new plan Plan newPlan = new Plan(scratchpad); // Add all trained skill levels that the character has trained so far foreach (Skill skill in character.Skills) { newPlan.PlanTo(skill, skill.Level); } // Create a new remapping RemappingResult remapping = new RemappingResult(scratchpad); // Add those skills to the remapping foreach (PlanEntry 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> /// <exception cref="System.ArgumentNullException">plan</exception> public static Collection <RemappingResult> GetResultsFromRemappingPoints(BasePlan plan) { plan.ThrowIfNull(nameof(plan)); CharacterScratchpad scratchpad = new CharacterScratchpad(plan.Character.After(plan.ChosenImplantSet)); Collection <RemappingResult> remappingList = new Collection <RemappingResult>(); Collection <ISkillLevel> list = new Collection <ISkillLevel>(); // Scroll through the entries and split it into remappings foreach (PlanEntry entry in plan) { // Ends the current remapping and start a new one if (entry.Remapping != null) { // Creates a new remapping RemappingResult 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> /// Updates the statistics for the plan editor. /// </summary> /// <param name="plan"></param> /// <param name="areRemappingPointsActive"></param> public void UpdateStatistics(BasePlan plan, out bool areRemappingPointsActive) { areRemappingPointsActive = true; var scratchpad = CreateModifiedScratchpad(); plan.UpdateStatistics(scratchpad, true, true); plan.UpdateOldTrainingTimes(); }
/// <summary> /// Constructor for use in code when optimizing remapping. /// </summary> /// <param name="character">Character information</param> /// <param name="plan">Plan to optimize for</param> /// <param name="strategy">Optimization strategy</param> /// <param name="name">Title of this form</param> /// <param name="description">Description of the optimization operation</param> public AttributesOptimizationForm(Character character, BasePlan plan, Strategy strategy, string name, string description) : this() { m_character = character; m_strategy = strategy; m_plan = plan; this.Text = name; this.labelDescription.Text = description; }
/// <summary> /// Constructor for use in code when optimizing remapping. /// </summary> /// <param name="character">Character information</param> /// <param name="plan">Plan to optimize for</param> /// <param name="strategy">Optimization strategy</param> /// <param name="name">Title of this form</param> /// <param name="description">Description of the optimization operation</param> public AttributesOptimizationForm(Character character, BasePlan plan, Strategy strategy, string name, string description) : this() { m_character = character; m_baseCharacter = character.After(plan.ChosenImplantSet); m_strategy = strategy; m_plan = plan; m_description = description; Text = name; }
/// <summary> /// Constructor for use in code when the user wants to manually edit a remapping point. /// </summary> /// <param name="character">Character information</param> /// <param name="plan">Plan to optimize for</param> /// <param name="strategy">Optimization strategy</param> /// <param name="name">Title of this form</param> /// <param name="description">Description of the optimization operation</param> public AttributesOptimizationForm(Character character, BasePlan plan, RemappingPoint point, string planName) : this() { m_plan = plan; m_character = character; m_manuallyEditedRemappingPoint = point; m_strategy = Strategy.ManualRemappingPointEdition; this.Text = "Remapping point edition (" + planName + ")"; this.labelDescription.Text = "Manual edition of a remapping point"; }
/// <summary> /// Updates bars and labels with given attributes from remapping. /// </summary> /// <param name="character">Character information</param> /// <param name="plan">Skill plan</param> /// <param name="remapping">Remapping with attributes and training time</param> /// <param name="description"></param> private void UpdateControls(Character character, BasePlan plan, AttributesOptimizer.RemappingResult remapping, string description) { var baseCharacter = character.After(plan.ChosenImplantSet); UpdateAttributeControls(baseCharacter, remapping, EveAttribute.Perception, lbPER, pbPERRemappable, pbPERImplants); UpdateAttributeControls(baseCharacter, remapping, EveAttribute.Willpower, lbWIL, pbWILRemappable, pbWILImplants); UpdateAttributeControls(baseCharacter, remapping, EveAttribute.Memory, lbMEM, pbMEMRemappable, pbMEMImplants); UpdateAttributeControls(baseCharacter, remapping, EveAttribute.Intelligence, lbINT, pbINTRemappable, pbINTImplants); UpdateAttributeControls(baseCharacter, remapping, EveAttribute.Charisma, lbCHA, pbCHARemappable, pbCHAImplants); // Update the description label labelDescription.Text = description; // Update the current time control lbCurrentTime.Text = remapping.BaseDuration.ToDescriptiveText(DescriptiveTextOptions.IncludeCommas); // Update the optimized time control lbOptimizedTime.Text = remapping.BestDuration.ToDescriptiveText(DescriptiveTextOptions.IncludeCommas); // Update the time benefit control if (remapping.BestDuration < remapping.BaseDuration) { lbGain.ForeColor = Color.Black; lbGain.Text = String.Format("{0} better than current", remapping.BaseDuration.Subtract(remapping.BestDuration).ToDescriptiveText(DescriptiveTextOptions.IncludeCommas)); } else if (remapping.BaseDuration < remapping.BestDuration) { lbGain.ForeColor = Color.DarkRed; lbGain.Text = String.Format("{0} slower than current", remapping.BestDuration.Subtract(remapping.BaseDuration).ToDescriptiveText(DescriptiveTextOptions.IncludeCommas)); } else { lbGain.ForeColor = Color.Black; lbGain.Text = @"Same as current"; } // A plan may not have a years worth of skills in it, // only fair to warn the user lbWarning.Visible = remapping.BestDuration < new TimeSpan(365, 0, 0, 0); // Spare points int sparePoints = EveConstants.SpareAttributePointsOnRemap; for (int i = 0; i < 5; i++) { sparePoints -= (remapping.BestScratchpad[(EveAttribute)i].Base) - EveConstants.CharacterBaseAttributePoints; } pbUnassigned.Value = sparePoints; // If the implant set isn't the active one we notify the user lblNotice.Visible = (plan.ChosenImplantSet != character.ImplantSets.Current); }
/// <summary> /// Initializes a new instance of <see cref="AttributesOptimizationControl"/>. /// </summary> /// <param name="character">Character information</param> /// <param name="plan">Skill plan</param> /// <param name="remapping">Optimized remapping</param> /// <param name="description"></param> public AttributesOptimizationControl(Character character, BasePlan plan, AttributesOptimizer.RemappingResult remapping, string description) { InitializeComponent(); m_character = character; m_plan = plan; m_remapping = remapping; m_description = description; UpdateControls(m_character, m_plan, m_remapping, m_description); }
/// <summary> /// Constructor for use in code when the user wants to manually edit a remapping point. /// </summary> /// <param name="character">Character information</param> /// <param name="plan">Plan to optimize for</param> /// <param name="strategy">Optimization strategy</param> /// <param name="name">Title of this form</param> /// <param name="description">Description of the optimization operation</param> public AttributesOptimizationForm(Character character, Plan plan, RemappingPoint point) : this() { m_plan = plan; m_character = character; m_baseCharacter = character.After(plan.ChosenImplantSet); m_manuallyEditedRemappingPoint = point; m_strategy = Strategy.ManualRemappingPointEdition; m_description = "Manual editing of a remapping point"; Text = "Remapping point manual editing (" + plan.Name + ")"; }
/// <summary> /// Updates the statistics for the plan editor. /// </summary> /// <param name="plan"></param> /// <param name="areRemappingPointsActive"></param> /// <exception cref="System.ArgumentNullException">plan</exception> public void UpdateStatistics(BasePlan plan, out bool areRemappingPointsActive) { plan.ThrowIfNull(nameof(plan)); areRemappingPointsActive = true; CharacterScratchpad scratchpad = CreateModifiedScratchpad(m_character.After(m_plan.ChosenImplantSet)); plan.UpdateStatistics(scratchpad, true, true); plan.UpdateOldTrainingTimes(); }
/// <summary> /// Constructor. /// </summary> /// <param name="owner">The owner.</param> /// <param name="skill">The skill.</param> /// <param name="level">The level.</param> public PlanEntry(BasePlan owner, StaticSkill skill, Int64 level) { m_owner = owner; m_skill = skill; m_level = level; m_priority = DefaultPriority; m_notes = String.Empty; OldTrainingTime = TimeSpan.Zero; TrainingTime = TimeSpan.Zero; }
/// <summary> /// Updates bars and labels with given attributes from remapping. /// </summary> /// <param name="character">Character information</param> /// <param name="plan">Skill plan</param> /// <param name="remapping">Remapping with attributes and training time</param> /// <param name="description"></param> private void UpdateControls(Character character, BasePlan plan, RemappingResult remapping, string description) { UpdateAttributeControls(remapping, EveAttribute.Perception, lbPER, pbPERRemappable, pbPERImplants); UpdateAttributeControls(remapping, EveAttribute.Willpower, lbWIL, pbWILRemappable, pbWILImplants); UpdateAttributeControls(remapping, EveAttribute.Memory, lbMEM, pbMEMRemappable, pbMEMImplants); UpdateAttributeControls(remapping, EveAttribute.Intelligence, lbINT, pbINTRemappable, pbINTImplants); UpdateAttributeControls(remapping, EveAttribute.Charisma, lbCHA, pbCHARemappable, pbCHAImplants); // Update the description label labelDescription.Text = description; // Update the current time control lbCurrentTime.Text = remapping.BaseDuration.ToDescriptiveText(DescriptiveTextOptions.IncludeCommas); // Update the optimized time control lbOptimizedTime.Text = remapping.BestDuration.ToDescriptiveText(DescriptiveTextOptions.IncludeCommas); // Update the time benefit control string bestDurationTimeText = remapping.BaseDuration.Subtract(remapping.BestDuration) .ToDescriptiveText(DescriptiveTextOptions.IncludeCommas); string worseDurationTimeText = remapping.BestDuration.Subtract(remapping.BaseDuration) .ToDescriptiveText(DescriptiveTextOptions.IncludeCommas); lbGain.ForeColor = remapping.BestDuration < remapping.BaseDuration ? Color.DarkGreen : remapping.BaseDuration < remapping.BestDuration ? Color.DarkRed : Color.Black; lbGain.Text = remapping.BestDuration < remapping.BaseDuration ? $"{bestDurationTimeText} better than current" : remapping.BaseDuration < remapping.BestDuration ? $"{worseDurationTimeText} slower than current" : "Same as current"; // A plan may not have a years worth of skills in it, // only fair to warn the user lbWarning.Visible = remapping.BestDuration < TimeSpan.FromDays(365); // Spare points Int64 sparePoints = EveConstants.SpareAttributePointsOnRemap; for (int i = 0; i < 5; i++) { sparePoints -= remapping.BestScratchpad[(EveAttribute)i].Base - EveConstants.CharacterBaseAttributePoints; } pbUnassigned.Value = sparePoints; // If the implant set isn't the active one we notify the user lblNotice.Visible = plan.ChosenImplantSet != character.ImplantSets.Current; }
/// <summary> /// Initializes a new instance of the <see cref="AttributesOptimizerWindow"/> class. /// Constructor used in WindowsFactory. /// </summary> /// <param name="planEditorControl">The plan editor control.</param> /// <param name="strategy">Optimization strategy</param> /// <exception cref="System.ArgumentNullException">planEditorControl</exception> public AttributesOptimizerWindow(PlanEditorControl planEditorControl, AttributeOptimizationStrategy strategy) : this() { planEditorControl.ThrowIfNull(nameof(planEditorControl)); m_planEditor = planEditorControl; m_plan = planEditorControl.Plan; m_character = (Character)m_plan.Character; m_baseCharacter = m_character.After(m_plan.ChosenImplantSet); m_strategy = strategy; // Update title and description UpdateTitle(); }
/// <summary> /// Deserialization constructor. /// </summary> /// <param name="owner">The owner.</param> /// <param name="serial">The 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; m_planGroups.AddRange(serial.PlanGroups); if (serial.Remapping != null) m_remapping = new RemappingPoint(serial.Remapping); }
/// <summary> /// Updates the statistics for the plan editor. /// </summary> /// <param name="plan"></param> /// <param name="areRemappingPointsActive"></param> public void UpdateStatistics(BasePlan plan, out bool areRemappingPointsActive) { areRemappingPointsActive = m_areRemappingPointsActive; if (m_areRemappingPointsActive) { plan.UpdateStatistics(new CharacterScratchpad(m_character), true, true); plan.UpdateOldTrainingTimes(new CharacterScratchpad(m_character), false, true); } else { plan.UpdateStatistics(m_statisticsScratchpad.Clone(), false, true); plan.UpdateOldTrainingTimes(new CharacterScratchpad(m_character), true, true); } }
protected void BindBasePlans() { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("Name", typeof(string))); dt.Columns.Add(new DataColumn("BasePlanSlotId", typeof(int))); Hashtable ht = ProjectSpreadSheet.GetFilledSlotHash(int.Parse(Request["ProjectId"])); if (ht.Keys.Count <= 0) { trBasePlanFilter.Visible = false; } foreach (BasePlanSlot bps in BasePlanSlot.List()) { DataRow row = dt.NewRow(); row["BasePlanSlotId"] = bps.BasePlanSlotId; DateTime d_time = DateTime.MinValue; if (ht.Contains(bps.BasePlanSlotId)) { foreach (BasePlan bp in BasePlan.List(int.Parse(Request["ProjectId"]))) { if (bp.BasePlanSlotId == bps.BasePlanSlotId) { d_time = bp.Created; break; } } } if (d_time != DateTime.MinValue) { row["Name"] = String.Format("{0} ({1}: {2})", bps.Name, LocRM.GetString("LastSaved"), d_time); } else { continue; } dt.Rows.Add(row); } ddlBasePlans.DataSource = dt; ddlBasePlans.DataTextField = "Name"; ddlBasePlans.DataValueField = "BasePlanSlotId"; ddlBasePlans.DataBind(); ddlBasePlans.Items.Insert(0, new ListItem(LocRM.GetString("NotSet"), "-1")); ddlBasePlans.SelectedValue = BasePlanSlotId.ToString(); }
void BindDropDown() { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("Name", typeof(string))); dt.Columns.Add(new DataColumn("BasePlanSlotId", typeof(int))); Hashtable ht = ProjectSpreadSheet.GetFilledSlotHash(int.Parse(Request["ProjectId"])); int selvalue = -1; DateTime d_time = DateTime.Now; foreach (BasePlanSlot bps in BasePlanSlot.List()) { if (bps.IsDefault) { selvalue = bps.BasePlanSlotId; } DataRow row = dt.NewRow(); row["BasePlanSlotId"] = bps.BasePlanSlotId; if (ht.Contains(bps.BasePlanSlotId)) { foreach (BasePlan bp in BasePlan.List(int.Parse(Request["ProjectId"]))) { if (bp.BasePlanSlotId == bps.BasePlanSlotId) { d_time = bp.Created; break; } } row["Name"] = String.Format("{0} ({1}: {2})", bps.Name, LocRM.GetString("LastSaved"), d_time); //row["Created"] = ht[bps.BasePlanSlotId]; } else { row["Name"] = bps.Name; } dt.Rows.Add(row); } ddBasePlan.DataSource = dt; ddBasePlan.DataTextField = "Name"; ddBasePlan.DataValueField = "BasePlanSlotId"; ddBasePlan.DataBind(); ddBasePlan.SelectedValue = selvalue.ToString(); }
/// <summary> /// Compute the best remapping for the first year of this plan. /// </summary> /// <param name="plan"></param> /// <returns></returns> /// <exception cref="System.ArgumentNullException">plan</exception> public static RemappingResult OptimizeFromFirstYearOfPlan(BasePlan plan) { plan.ThrowIfNull(nameof(plan)); RemappingResult remapping = new RemappingResult(new CharacterScratchpad(plan.Character.After(plan.ChosenImplantSet))); // Scroll through the entries and split it into remappings foreach (PlanEntry entry in plan) { remapping.Skills.Add(entry); } // Compute remapping.Optimize(TimeSpan.FromDays(365.0)); return(remapping); }
/// <summary> /// Initializes a new instance of <see cref="AttributesOptimizerControl"/>. /// </summary> /// <param name="character">Character information</param> /// <param name="plan">Skill plan</param> /// <param name="remapping">Optimized remapping</param> /// <param name="description"></param> public AttributesOptimizerControl(Character character, BasePlan plan, RemappingResult remapping, string description) { InitializeComponent(); lbMEM.Font = FontFactory.GetFont("Tahoma"); lbWIL.Font = FontFactory.GetFont("Tahoma"); lbCHA.Font = FontFactory.GetFont("Tahoma"); lbPER.Font = FontFactory.GetFont("Tahoma"); lbINT.Font = FontFactory.GetFont("Tahoma"); m_character = character; m_plan = plan; m_remapping = remapping; m_description = description; UpdateControls(m_character, m_plan, m_remapping, m_description); }
/// <summary> /// Updates the statistics for the plan editor. /// </summary> /// <param name="plan"></param> /// <param name="areRemappingPointsActive"></param> /// <exception cref="System.ArgumentNullException">plan</exception> public void UpdateStatistics(BasePlan plan, out bool areRemappingPointsActive) { plan.ThrowIfNull(nameof(plan)); areRemappingPointsActive = m_areRemappingPointsActive; if (m_areRemappingPointsActive) { plan.UpdateStatistics(new CharacterScratchpad(m_baseCharacter.After(plan.ChosenImplantSet)), true, true); } else { plan.UpdateStatistics(m_statisticsScratchpad.Clone(), false, true); } plan.UpdateOldTrainingTimes(new CharacterScratchpad(m_baseCharacter.After(plan.ChosenImplantSet)), false, true); }
void BindDropDowns() { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("Id", typeof(int))); dt.Columns.Add(new DataColumn("Name", typeof(string))); dt.Rows.Add(new object[] { 1, LocRM.GetString("tWeekYear") }); dt.Rows.Add(new object[] { 2, LocRM.GetString("tMonthQuarterYear") }); dt.Rows.Add(new object[] { 3, LocRM.GetString("tQuarterYear") }); dt.Rows.Add(new object[] { 4, LocRM.GetString("tYear") }); dt.Rows.Add(new object[] { 5, LocRM.GetString("tTotal") }); ArrayList list = new ArrayList(SpreadSheetTemplateInfo.List()); list.Sort(new SortComparer()); ddTemplate.DataSource = list; //SpreadSheetTemplateInfo.List(); ddTemplate.DataTextField = "Name"; ddTemplate.DataValueField = "FileName"; ddTemplate.DataBind(); ddDocType.DataSource = dt; ddDocType.DataTextField = "Name"; ddDocType.DataValueField = "Id"; ddDocType.DataBind(); ddDocType.SelectedValue = "2"; DataTable dt2 = new DataTable(); dt2.Columns.Add(new DataColumn("Id", typeof(int))); dt2.Columns.Add(new DataColumn("Name", typeof(string))); foreach (BasePlan bp in BasePlan.List(ProjectId)) { DataRow row = dt2.NewRow(); row["Id"] = bp.BasePlanSlotId; row["Name"] = String.Format("{0} ({1}: {2})", BasePlanSlot.Load(bp.BasePlanSlotId).Name, LocRM.GetString("LastSaved"), bp.Created); dt2.Rows.Add(row); } dt2.Rows.Add(new object[] { -1, LocRM.GetString("Fact") }); dt2.Rows.Add(new object[] { 0, LocRM.GetString("Current") }); DataView dv = dt2.DefaultView; dv.Sort = "Id ASC"; ddPrimarySheet.DataSource = dv; ddPrimarySheet.DataTextField = "Name"; ddPrimarySheet.DataValueField = "Id"; ddPrimarySheet.DataBind(); ddPrimarySheet.SelectedValue = "0"; dt2.Rows.Add(new object[] { -2, LocRM.GetString("NotSelected") }); ddSecondarySheet.DataSource = dv; ddSecondarySheet.DataTextField = "Name"; ddSecondarySheet.DataValueField = "Id"; ddSecondarySheet.DataBind(); ddSecondarySheet.SelectedValue = "-2"; tbFrom.Text = DateTime.Now.Year.ToString(); tbTo.Text = DateTime.Now.Year.ToString(); BindUserValues(); }
/// <summary> /// Updates the statistics for the plan editor. /// </summary> /// <param name="plan"></param> /// <param name="areRemappingPointsActive"></param> /// <exception cref="System.ArgumentNullException">plan</exception> public void UpdateStatistics(BasePlan plan, out bool areRemappingPointsActive) { plan.ThrowIfNull(nameof(plan)); areRemappingPointsActive = m_areRemappingPointsActive; if (m_areRemappingPointsActive) plan.UpdateStatistics(new CharacterScratchpad(m_baseCharacter.After(plan.ChosenImplantSet)), true, true); else plan.UpdateStatistics(m_statisticsScratchpad.Clone(), false, true); plan.UpdateOldTrainingTimes(new CharacterScratchpad(m_baseCharacter.After(plan.ChosenImplantSet)), false, true); }
/// <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) { m_entryType = m_entryType, m_priority = m_priority, m_notes = m_notes, m_remapping = m_remapping?.Clone(), OldTrainingTime = OldTrainingTime, TrainingTime = TrainingTime }; clone.m_planGroups.AddRange(m_planGroups); return clone; }
/// <summary> /// Updates bars and labels with given attributes from remapping. /// </summary> /// <param name="character">Character information</param> /// <param name="plan">Skill plan</param> /// <param name="remapping">Remapping with attributes and training time</param> /// <param name="description"></param> private void UpdateControls(Character character, BasePlan plan, AttributesOptimizer.RemappingResult remapping, string description) { var baseCharacter = character.After(plan.ChosenImplantSet); UpdateAttributeControls(baseCharacter, remapping, EveAttribute.Perception, lbPER, pbPERRemappable, pbPERImplants); UpdateAttributeControls(baseCharacter, remapping, EveAttribute.Willpower, lbWIL, pbWILRemappable, pbWILImplants); UpdateAttributeControls(baseCharacter, remapping, EveAttribute.Memory, lbMEM, pbMEMRemappable, pbMEMImplants); UpdateAttributeControls(baseCharacter, remapping, EveAttribute.Intelligence, lbINT, pbINTRemappable, pbINTImplants); UpdateAttributeControls(baseCharacter, remapping, EveAttribute.Charisma, lbCHA, pbCHARemappable, pbCHAImplants); // Update the description label labelDescription.Text = description; // Update the current time control lbCurrentTime.Text = remapping.BaseDuration.ToDescriptiveText(DescriptiveTextOptions.IncludeCommas); // Update the optimized time control lbOptimizedTime.Text = remapping.BestDuration.ToDescriptiveText(DescriptiveTextOptions.IncludeCommas); // Update the time benefit control if (remapping.BestDuration < remapping.BaseDuration) { lbGain.ForeColor = Color.Black; lbGain.Text = String.Format("{0} better than current", remapping.BaseDuration.Subtract(remapping.BestDuration).ToDescriptiveText(DescriptiveTextOptions.IncludeCommas)); } else if (remapping.BaseDuration < remapping.BestDuration) { lbGain.ForeColor = Color.DarkRed; lbGain.Text = String.Format("{0} slower than current", remapping.BestDuration.Subtract(remapping.BaseDuration).ToDescriptiveText(DescriptiveTextOptions.IncludeCommas)); } else { lbGain.ForeColor = Color.Black; lbGain.Text = @"Same as current"; } // A plan may not have a years worth of skills in it, // only fair to warn the user lbWarning.Visible = remapping.BestDuration < new TimeSpan(365, 0, 0, 0); // Spare points int sparePoints = EveConstants.SpareAttributePointsOnRemap; for (int i = 0; i < 5; i++) { sparePoints -= (remapping.BestScratchpad[(EveAttribute)i].Base)- EveConstants.CharacterBaseAttributePoints; } pbUnassigned.Value = sparePoints; // If the implant set isn't the active one we notify the user lblNotice.Visible = (plan.ChosenImplantSet != character.ImplantSets.Current); }
/// <summary> /// Generate a trainings array from a plan /// </summary> /// <param name="plan"></param> /// <returns></returns> public static ICollection <RemappingResult> OptimizeFromPlanAndRemappingPoints(BasePlan plan) { Collection <RemappingResult> results = GetResultsFromRemappingPoints(plan); foreach (RemappingResult result in results) { result.Optimize(TimeSpan.MaxValue); } return(results); }
/// <summary> /// Adds the footer. /// </summary> /// <param name="settings">The settings.</param> /// <param name="boldEnd">The bold end.</param> /// <param name="index">The index.</param> /// <param name="endTime">The end time.</param> /// <param name="builder">The builder.</param> /// <param name="lineFeed">The line feed.</param> /// <param name="plan">The plan.</param> /// <param name="boldStart">The bold start.</param> private static void AddFooter(PlanExportSettings settings, string boldEnd, int index, DateTime endTime, StringBuilder builder, string lineFeed, BasePlan plan, string boldStart) { if (!settings.FooterCount && !settings.FooterTotalTime && !settings.FooterDate && !settings.FooterCost) return; builder.AppendLine(lineFeed); bool needComma = false; // Skills count if (settings.FooterCount) { builder .Append($"{boldStart}{plan.GetUniqueSkillsCount()}{boldEnd} " + $"unique skill{(plan.GetUniqueSkillsCount() == 1 ? String.Empty : "s")}, ") .Append($"{boldStart}{index}{boldEnd} skill level{(index == 1 ? String.Empty : "s")}"); needComma = true; } // Plan's training duration if (settings.FooterTotalTime) { const DescriptiveTextOptions TimeFormat = DescriptiveTextOptions.FullText | DescriptiveTextOptions.IncludeCommas | DescriptiveTextOptions.SpaceText; if (needComma) builder.Append("; "); needComma = true; builder.Append($"Total time: {boldStart}{plan.TotalTrainingTime.ToDescriptiveText(TimeFormat)}{boldEnd}"); } // End training date if (settings.FooterDate) { if (needComma) builder.Append("; "); needComma = true; builder.Append($"Completion: {boldStart}{endTime.ToUniversalTime().DateTimeToTimeString()}{boldEnd} UTC"); } // Total books cost if (settings.FooterCost) { if (needComma) builder.Append("; "); string formattedIsk = FormattableString.Invariant($"{plan.NotKnownSkillBooksCost:N0}"); builder.Append($"Cost: {boldStart}{formattedIsk}{boldEnd} ISK"); } // Warning about skill costs builder.Append(lineFeed); if (settings.FooterCost || settings.EntryCost) builder.Append("N.B. Skill costs are based on CCP's database and are indicative only"); }
/// <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; }
private void btnOk_ServerClick(object sender, EventArgs e) { BasePlan.Save(int.Parse(Request["ProjectId"]), int.Parse(ddBasePlan.SelectedValue)); ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "window.opener.location.href=window.opener.location.href; window.close();", true); }
/// <summary> /// Adds the footer. /// </summary> /// <param name="settings">The settings.</param> /// <param name="boldEnd">The bold end.</param> /// <param name="index">The index.</param> /// <param name="endTime">The end time.</param> /// <param name="builder">The builder.</param> /// <param name="lineFeed">The line feed.</param> /// <param name="plan">The plan.</param> /// <param name="boldStart">The bold start.</param> private static void AddFooter(PlanExportSettings settings, string boldEnd, int index, DateTime endTime, StringBuilder builder, string lineFeed, BasePlan plan, string boldStart) { if (!settings.FooterCount && !settings.FooterTotalTime && !settings.FooterDate && !settings.FooterCost) { return; } builder.AppendLine(lineFeed); bool needComma = false; // Skills count if (settings.FooterCount) { builder .Append($"{boldStart}{plan.GetUniqueSkillsCount()}{boldEnd} " + $"unique skill{(plan.GetUniqueSkillsCount() == 1 ? string.Empty : "s")}, ") .Append($"{boldStart}{index}{boldEnd} skill level{(index == 1 ? string.Empty : "s")}"); needComma = true; } // Plan's training duration if (settings.FooterTotalTime) { const DescriptiveTextOptions TimeFormat = DescriptiveTextOptions.FullText | DescriptiveTextOptions.IncludeCommas | DescriptiveTextOptions.SpaceText; if (needComma) { builder.Append("; "); } needComma = true; builder.Append($"Total time: {boldStart}{plan.TotalTrainingTime.ToDescriptiveText(TimeFormat)}{boldEnd}"); } // End training date if (settings.FooterDate) { if (needComma) { builder.Append("; "); } needComma = true; builder.Append($"Completion: {boldStart}{endTime.ToUniversalTime().DateTimeToTimeString()}{boldEnd} UTC"); } // Total books cost if (settings.FooterCost) { if (needComma) { builder.Append("; "); } string formattedIsk = FormattableString.Invariant($"{plan.NotKnownSkillBooksCost:N0}"); builder.Append($"Cost: {boldStart}{formattedIsk}{boldEnd} ISK"); } // Warning about skill costs builder.Append(lineFeed); if (settings.FooterCost || settings.EntryCost) { builder.Append("N.B. Skill costs are based on CCP's database and are indicative only"); } }