Exemple #1
0
        /// <summary>
        /// Updates the statistics of the entries in the same way the given character would train this plan.
        /// </summary>
        /// <param name="scratchpad">The scratchpad.</param>
        /// <param name="applyRemappingPoints">if set to <c>true</c> [apply remapping points].</param>
        /// <param name="trainSkills">When true, the character will train every skill, increasing SP, etc.</param>
        /// <exception cref="System.ArgumentNullException">scratchpad</exception>
        public void UpdateStatistics(CharacterScratchpad scratchpad, bool applyRemappingPoints, bool trainSkills)
        {
            scratchpad.ThrowIfNull(nameof(scratchpad));

            CharacterScratchpad scratchpadWithoutImplants = scratchpad.Clone();

            scratchpadWithoutImplants.ClearImplants();
            DateTime time = DateTime.Now;

            // Update the statistics
            foreach (PlanEntry entry in Items)
            {
                // Apply the remapping
                if (applyRemappingPoints && entry.Remapping != null &&
                    entry.Remapping.Status == RemappingPointStatus.UpToDate)
                {
                    scratchpad.Remap(entry.Remapping);
                    scratchpadWithoutImplants.Remap(entry.Remapping);
                }

                // Update entry's statistics
                entry.UpdateStatistics(scratchpad, scratchpadWithoutImplants, ref time);

                // Update the scratchpad
                if (!trainSkills)
                {
                    continue;
                }

                scratchpad.Train(entry.Skill, entry.Level);
                scratchpadWithoutImplants.Train(entry.Skill, entry.Level);
            }
        }
Exemple #2
0
        /// <summary>
        /// Constructor without any remapping point associated.
        /// </summary>
        /// <param name="baseScratchpad">The base scratchpad.</param>
        /// <exception cref="System.ArgumentNullException">baseScratchpad</exception>
        public RemappingResult(CharacterScratchpad baseScratchpad)
        {
            baseScratchpad.ThrowIfNull(nameof(baseScratchpad));

            Skills = new Collection<ISkillLevel>();
            BaseScratchpad = baseScratchpad;
            StartTime = BaseScratchpad.TrainingTime;
        }
Exemple #3
0
        /// <summary>
        /// Constructor without any remapping point associated.
        /// </summary>
        /// <param name="baseScratchpad">The base scratchpad.</param>
        /// <exception cref="System.ArgumentNullException">baseScratchpad</exception>
        public RemappingResult(CharacterScratchpad baseScratchpad)
        {
            baseScratchpad.ThrowIfNull(nameof(baseScratchpad));

            Skills         = new Collection <ISkillLevel>();
            BaseScratchpad = baseScratchpad;
            StartTime      = BaseScratchpad.TrainingTime;
        }
Exemple #4
0
        /// <summary>
        /// Gets a string representation of the attribute.
        /// </summary>
        /// <param name="attrib">The attribute.</param>
        /// <param name="oldScratchpad">The old scratchpad.</param>
        /// <param name="newScratchpad">The new scratchpad.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">
        /// oldScratchpad
        /// or
        /// newScratchpad
        /// </exception>
        public static string GetStringForAttribute(EveAttribute attrib, CharacterScratchpad oldScratchpad,
                                                   CharacterScratchpad newScratchpad)
        {
            oldScratchpad.ThrowIfNull(nameof(oldScratchpad));

            newScratchpad.ThrowIfNull(nameof(newScratchpad));

            long bonusDifference = newScratchpad[attrib].Base - oldScratchpad[attrib].Base;

            if (bonusDifference == 0)
            {
                return(newScratchpad[attrib].ToString("%N (0) = %e = (%B + %r + %i)"));
            }

            return(newScratchpad[attrib].ToString(bonusDifference > 0
                ? $"%N (+{bonusDifference}) = %e = (%B + %r + %i)"
                : $"%N ({bonusDifference}) = %e = (%B + %r + %i)"));
        }
Exemple #5
0
        /// <summary>
        /// Updates the statistics of the entries in the same way the given character would train this plan.
        /// </summary>
        /// <param name="scratchpad">The scratchpad.</param>
        /// <param name="applyRemappingPoints">if set to <c>true</c> [apply remapping points].</param>
        /// <param name="trainSkills">When true, the character will train every skill, increasing SP, etc.</param>
        /// <exception cref="System.ArgumentNullException">scratchpad</exception>
        public void UpdateOldTrainingTimes(CharacterScratchpad scratchpad, bool applyRemappingPoints, bool trainSkills)
        {
            scratchpad.ThrowIfNull(nameof(scratchpad));

            // Update the statistics
            foreach (PlanEntry entry in Items)
            {
                // Apply the remapping
                if (applyRemappingPoints && entry.Remapping != null &&
                    entry.Remapping.Status == RemappingPointStatus.UpToDate)
                {
                    scratchpad.Remap(entry.Remapping);
                }

                // Update entry's statistics
                entry.UpdateOldTrainingTime(scratchpad);

                // Update the scratchpad
                if (trainSkills)
                {
                    scratchpad.Train(entry.Skill, entry.Level);
                }
            }
        }
Exemple #6
0
        /// <summary>
        /// Gets a string representation of the attribute.
        /// </summary>
        /// <param name="attrib">The attribute.</param>
        /// <param name="oldScratchpad">The old scratchpad.</param>
        /// <param name="newScratchpad">The new scratchpad.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">
        /// oldScratchpad
        /// or
        /// newScratchpad
        /// </exception>
        public static string GetStringForAttribute(EveAttribute attrib, CharacterScratchpad oldScratchpad,
            CharacterScratchpad newScratchpad)
        {
            oldScratchpad.ThrowIfNull(nameof(oldScratchpad));

            newScratchpad.ThrowIfNull(nameof(newScratchpad));

            Int64 bonusDifference = newScratchpad[attrib].Base - oldScratchpad[attrib].Base;

            if (bonusDifference == 0)
                return newScratchpad[attrib].ToString("%N (0) = %e = (%B + %r + %i)");

            return newScratchpad[attrib].ToString(bonusDifference > 0
                ? $"%N (+{bonusDifference}) = %e = (%B + %r + %i)"
                : $"%N ({bonusDifference}) = %e = (%B + %r + %i)");
        }