/// <summary>
 /// Constructor used in code.
 /// </summary>
 /// <param name="character"></param>
 public ImplantSetsWindow(Character character)
     : this()
 {
     m_character = character;
     m_sets = character.ImplantSets.Export();
     m_maxJumpClones = character.Skills["Infomorph Psychology"].Level;
 }
        /// <summary>
        /// Regular constructor for use in code.
        /// </summary>
        /// <param name="character"></param>
        public PlanManagementWindow(Character character)
            : this()
        {
            m_character = character;
            m_columnSorter = new PlanComparer(PlanSort.Name);

            EveClient.CharacterPlanCollectionChanged += new EventHandler<CharacterChangedEventArgs>(EveClient_CharacterPlanCollectionChanged);
        }
Exemple #3
0
        /// <summary>
        /// Constructor at character's initialization time
        /// </summary>
        /// <param name="character"></param>
        /// <param name="src"></param>
        /// <param name="certClass"></param>
        internal Certificate(Character character, StaticCertificate src, CertificateClass certClass)
        {
            m_staticData = src;
            m_class = certClass;
            m_character = character;
            m_status = CertificateStatus.Untrained;

            m_prereqSkills = new List<SkillLevel>(src.PrerequisiteSkills.ToCharacter(character));
            m_prereqCertificates = new List<Certificate>();
        }
 /// <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;
 }
        public AttributesOptimizationSettingsForm(Plan plan)
        {
            InitializeComponent();

            buttonWholePlan.Font = FontFactory.GetFont("Microsoft Sans Serif", 10F);
            buttonCharacter.Font = FontFactory.GetFont("Microsoft Sans Serif", 10F);
            buttonRemappingPoints.Font = FontFactory.GetFont("Microsoft Sans Serif", 10F);

            m_plan = plan;
            m_character = (Character)plan.Character;
        }
        /// <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 + ")";
 }
Exemple #8
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="plan">The plan.</param>
        private PlanPrinter(Plan plan)
        {
            m_plan = plan;
            m_plan.UpdateStatistics();

            m_character = (Character)plan.Character;
            m_settings = Settings.Exportation.PlanToText;

            m_brush = new SolidBrush(Color.Black);
            m_font = FontFactory.GetFont("Arial", 10);
            m_boldFont = FontFactory.GetFont("Arial", 10, FontStyle.Bold | FontStyle.Underline);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="ship"></param>
        /// <param name="plan"></param>
        public ShipLoadoutSelectWindow(Item ship, Plan plan)
            : this()
        {
            this.persistentSplitContainer1.RememberDistanceKey = "ShipLoadoutBrowser";

            m_character = (Character)plan.Character;
            m_plan = plan;
            m_ship = ship;

            m_columnSorter = new LoadoutListSorter(this);
            m_columnSorter.OrderOfSort = SortOrder.Descending;
            m_columnSorter.SortColumn = 2;
            lvLoadouts.ListViewItemSorter = m_columnSorter;
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="character"></param>
        public CharacterDeletionWindow(Character character)
        {
            InitializeComponent();
            m_character = character;
            m_account = character.Identity.Account;

            // Replaces end of text with character's name
            string newText = label1.Text.Replace("a character", m_character.Name);
            label1.Text = newText;

            // Checks whether there will be no characters left after this deletion and hide/display the relevant labels.
            int charactersLeft = EveClient.Characters.Count(x => x.Identity.Account == m_account);
            bool noCharactersLeft = (m_account != null && m_character is CCPCharacter && charactersLeft == 1);
            noCharactersCheckBox.Visible = noCharactersLeft;
            noCharactersLabel.Visible = noCharactersLeft;
        }
        public ExternalCalendarWindow(Character character)
        {
            InitializeComponent();

            m_character = character;

            if (Settings.Calendar.Provider == CalendarProvider.Outlook) OutlookRadioButton.Checked = true;
            else GoogleRadioButton.Checked = true;

            GoogleEmailTextBox.Text = Settings.Calendar.GoogleEmail;
            GooglePasswordTextBox.Text = Settings.Calendar.GooglePassword;
            GoogleUriTextBox.Text = Settings.Calendar.GoogleURL;
            GoogleReminderComboBox.SelectedIndex = (int)Settings.Calendar.GoogleReminder;
            SetReminderCheckBox.Checked = Settings.Calendar.UseReminding;
            ReminderTextBox.Text = Settings.Calendar.RemindingInterval.ToString();
            UseAlterateReminderCheckBox.Checked = Settings.Calendar.UseRemindingRange;
            EarlyReminderDateTimePicker.Value = Settings.Calendar.EarlyReminding;
            LateReminderDateTimePicker.Value = Settings.Calendar.LateReminding;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="character"></param>
        public SkillsPieChart(Character character)
        {
            InitializeComponent();
            this.RememberPositionKey = "SkillsPieChart";

            // Fields
            this.m_character = character;
            this.Text = "Skillgroup chart for " + character.Name;

            // Layout
            skillPieChartControl.LeftMargin = 20F;
            skillPieChartControl.TopMargin = 15F;
            skillPieChartControl.RightMargin = 20F;
            skillPieChartControl.BottomMargin = 15F;
            skillPieChartControl.FitChart = true;
            skillPieChartControl.SliceRelativeHeight = Settings.UI.SkillPieChart.SliceHeight;
            skillPieChartControl.InitialAngle = Settings.UI.SkillPieChart.InitialAngle;
            skillPieChartControl.ShadowStyle = ShadowStyle.GradualShadow;
            skillPieChartControl.EdgeColorType = EVEMon.PieChart.EdgeColorType.DarkerThanSurface;
            skillPieChartControl.EdgeLineWidth = 1F;
        }
Exemple #13
0
        /// <summary>
        /// Deserialization constructor
        /// </summary>
        /// <param name="character">The character for this training</param>
        /// <param name="serial">The serialization object for this training</param>
        /// <param name="isPaused">When true, the training is currently paused.</param>
        /// <param name="startTimeWhenPaused">Training starttime when the queue is actually paused. Indeed, in such case, CCP returns empty start and end time, so we compute a "what if we start now" scenario.</param>
        internal QueuedSkill(Character character, SerializableQueuedSkill serial, bool isPaused, ref DateTime startTimeWhenPaused)
        {
            m_owner = character;
            m_startSP = serial.StartSP;
            m_endSP = serial.EndSP;
            m_level = serial.Level;
            m_skill = character.Skills[serial.ID];

            if (!isPaused)
            {
                // Not paused, we should trust CCP
                m_startTime = serial.StartTime;
                m_endTime = serial.EndTime;
            }
            else
            {
                // StartTime and EndTime were empty on the serialization object if the skill was paused
                // So we compute a "what if we start now" scenario
                m_startTime = startTimeWhenPaused;
                if (m_skill != null)
                    startTimeWhenPaused += m_skill.GetLeftTrainingTimeForLevelOnly(m_level);
                m_endTime = startTimeWhenPaused;
            }
        }
        /// <summary>
        /// Creates a HTML format file for character exportation.
        /// </summary>
        /// <param name="character"></param>
        /// <param name="plan"></param>
        public static string ExportAsHTML(Character character, Plan plan)
        {
            // Retrieves a XML representation of this character
            var serial = new OutputCharacter();
            serial.Name = character.Name;
            serial.Balance = character.Balance;
            serial.CorporationName = character.CorporationName;
            serial.CharacterID = character.CharacterID;
            serial.BloodLine = character.Bloodline;
            serial.Gender = character.Gender;
            serial.Race = character.Race;

            serial.Intelligence = character.Intelligence.EffectiveValue;
            serial.Perception = character.Perception.EffectiveValue;
            serial.Willpower = character.Willpower.EffectiveValue;
            serial.Charisma = character.Charisma.EffectiveValue;
            serial.Memory = character.Memory.EffectiveValue;

            // Attributes enhancers
            foreach (var implant in character.CurrentImplants.Where(x => x != Implant.None && (int)x.Slot < 5))
            {
                serial.AttributeEnhancers.Add(new OutputAttributeEnhancer { Attribute = implant.Slot, Bonus = implant.Bonus, Name = implant.Name });
            }

            // Certificates
            foreach (var certClass in character.CertificateClasses)
            {
                var cert = certClass.HighestClaimedGrade;
                if (cert == null)
                    continue;

                serial.Certificates.Add(new OutputCertificate { Name = certClass.Name, Grade = cert.Grade.ToString() });
            }

            // Skills (grouped by skill groups)
            foreach (var skillGroup in character.SkillGroups)
            {
                int count = skillGroup.Where(x => x.IsKnown || (plan != null && plan.IsPlanned(x))).Select(x => GetMergedSkill(plan, x)).Count();
                int skillGroupTotalSP = skillGroup.Where(x => x.IsKnown || (plan != null && plan.IsPlanned(x))).Select(x => GetMergedSkill(plan, x)).Sum(x => x.Skillpoints);

                var outGroup = new OutputSkillGroup { Name = skillGroup.Name, SkillsCount = count, TotalSP = skillGroupTotalSP };

                foreach (var skill in skillGroup.Where(x => x.IsKnown || (plan != null && plan.IsPlanned(x))))
                {
                    var mergedSkill = GetMergedSkill(plan, skill);

                    outGroup.Skills.Add(new OutputSkill
                    {
                        Name = mergedSkill.Name,
                        Rank = skill.Rank,
                        Level = mergedSkill.Level,
                        SkillPoints = mergedSkill.Skillpoints,
                        RomanLevel = Skill.GetRomanForInt(mergedSkill.Level),
                        MaxSkillPoints = skill.StaticData.GetPointsRequiredForLevel(5)
                    });
                }

                if (outGroup.Skills.Count != 0)
                    serial.SkillGroups.Add(outGroup);
            }

            // Serializes to XML and apply a XSLT to generate the HTML doc
            var doc = Util.SerializeToXmlDocument(typeof(OutputCharacter), serial);

            var xslt = Util.LoadXSLT(Properties.Resources.XmlToHtmlXslt);
            var htmlDoc = Util.Transform(doc, xslt);

            // Returns the string representation of the generated doc
            return Util.GetXMLStringRepresentation(htmlDoc);
        }
        /// <summary>
        /// Creates a CHR format file for character exportation.
        /// </summary>
        /// <param name="character"></param>
        /// <param name="plan"></param>
        public static string ExportAsEFTCHR(Character character, Plan plan)
        {
            StringBuilder builder = new StringBuilder();

            foreach (var skill in character.Skills
                .Where(x => (x.IsPublic
                    && x.Group.ID != DBConstants.CorporationManagementSkillsGroupID
                && x.Group.ID != DBConstants.SocialSkillsGroupID
                && x.Group.ID != DBConstants.TradeSkillsGroupID))
                .Select(x => GetMergedSkill(plan, x)))
            {
                builder.AppendFormat(CultureConstants.DefaultCulture, "{0}={1}{2}", skill.Name, skill.Level, Environment.NewLine);
            }

            if (character.Identity.Account != null)
            {
                builder.AppendFormat(CultureConstants.DefaultCulture, "UserID={0}{1}", character.Identity.Account.UserID, Environment.NewLine);
                builder.AppendFormat(CultureConstants.DefaultCulture, "APIKey={0}{1}", character.Identity.Account.APIKey, Environment.NewLine);
                builder.AppendFormat(CultureConstants.DefaultCulture, "CharID={0}{1}", character.CharacterID, Environment.NewLine);
            }

            return builder.ToString();
        }
        /// <summary>
        /// Formats the characters skill summary as a multi-line string.
        /// </summary>
        /// <param name="character">The character.</param>
        /// <returns>Formatted list of information about a characters skills.</returns>
        private static string FormatSkillSummary(Character character)
        {
            StringBuilder output = new StringBuilder();

            // Using the .AppendLine() method of creating a multi line
            // string in this case as it is an interface requirement,
            // rather than a cultural preference.
            output.AppendFormat(CultureConstants.DefaultCulture, "Known Skills: {0}", character.KnownSkillCount).AppendLine();
            output.AppendFormat(CultureConstants.DefaultCulture, "Skills at Level V: {0}", character.GetSkillCountAtLevel(5)).AppendLine();
            output.AppendFormat(CultureConstants.DefaultCulture, "Total SP: {0:#,##0}", character.SkillPoints).AppendLine();
            output.AppendFormat(CultureConstants.DefaultCulture, "Clone Limit: {0:#,##0}", character.CloneSkillPoints).AppendLine();
            output.Append(character.CloneName);

            return output.ToString();
        }
        /// <summary>
        /// Gets the attribute text for a character.
        /// </summary>
        /// <param name="character">The character.</param>
        /// <param name="eveAttribute">The eve attribute.</param>
        /// <returns>Formatted string describing the attribute and its value.</returns>
        private static void SetAttributeLabel(Label label, Character character, EveAttribute eveAttribute)
        {
            label.Text = character[eveAttribute].EffectiveValue.ToString(CultureConstants.DefaultCulture);

            label.Tag = eveAttribute;
        }
Exemple #18
0
 /// <summary>
 /// Occurs whenever a G15 button has been pressed which requires EVEMon to requery the API for the specified character.
 /// </summary>
 static void Lcdisplay_APIUpdateRequested(Character character)
 {
     Dispatcher.Invoke(() =>
         {
             var ccpCharacter = character as CCPCharacter;
             if (ccpCharacter != null)
                 ccpCharacter.QueryMonitors.QueryEverything();
         });
 }
 /// <summary>
 /// Creates formatted string for character exportation.
 /// </summary>
 /// <param name="format"></param>
 /// <param name="character"></param>
 /// <param name="plan"></param>
 /// <returns></returns>
 public static string Export(CharacterSaveFormat format, Character character, Plan plan)
 {
     switch (format)
     {
         case CharacterSaveFormat.Text:
             return ExportAsText(character, plan);
         case CharacterSaveFormat.EFTCHR:
             return ExportAsEFTCHR(character, plan);
         case CharacterSaveFormat.EVEMonXML:
             return ExportAsEVEMonXML(character, plan);
         case CharacterSaveFormat.HTML:
             return ExportAsHTML(character, plan);
         case CharacterSaveFormat.CCPXML:
             return ExportAsCCPXML(character);
         default:
             throw new NotImplementedException();
     }
 }
        /// <summary>
        /// Creates a BBCode format file for character exportation.
        /// </summary>
        /// <param name="character"></param>
        public static string ExportAsBBCode(Character character)
        {
            StringBuilder result = new StringBuilder();

            result.AppendFormat(CultureConstants.DefaultCulture, "[b]{0}[/b]{1}", character.Name, Environment.NewLine);
            result.AppendLine();
            result.AppendLine("[b]Attributes[/b]");
            result.AppendLine("[table]");
            result.AppendFormat(CultureConstants.DefaultCulture, "[tr][td]Intelligence:[/td][td]{0}[/td][/tr]{1}", character.Intelligence.EffectiveValue.ToString().PadLeft(5), Environment.NewLine);
            result.AppendFormat(CultureConstants.DefaultCulture, "[tr][td]Perception:[/td][td]{0}[/td][/tr]{1}", character.Perception.EffectiveValue.ToString().PadLeft(5), Environment.NewLine);
            result.AppendFormat(CultureConstants.DefaultCulture, "[tr][td]Charisma:[/td][td]{0}[/td][/tr]{1}", character.Charisma.EffectiveValue.ToString().PadLeft(5), Environment.NewLine);
            result.AppendFormat(CultureConstants.DefaultCulture, "[tr][td]Willpower:[/td][td]{0}[/td][/tr]{1}", character.Willpower.EffectiveValue.ToString().PadLeft(5), Environment.NewLine);
            result.AppendFormat(CultureConstants.DefaultCulture, "[tr][td]Memory:[/td][td]{0}[/td][/tr]{1}", character.Memory.EffectiveValue.ToString().PadLeft(5), Environment.NewLine);
            result.AppendLine("[/table]");

            foreach (var skillGroup in character.SkillGroups)
            {
                var skillGroupAppended = false;
                foreach (var skill in skillGroup)
                {
                    if (skill.Level > 0)
                    {
                        if (!skillGroupAppended)
                        {
                            result.AppendLine();
                            result.AppendFormat(CultureConstants.DefaultCulture, "[b]{0}[/b]{1}", skillGroup.Name, Environment.NewLine);

                            skillGroupAppended = true;
                        }

                        result.AppendFormat(CultureConstants.DefaultCulture, "[img]{0}{1}.gif[/img] {2}{3}", NetworkConstants.MyEVELevelImage, skill.Level, skill.Name, Environment.NewLine);
                    }
                }

                if (skillGroupAppended)
                    result.AppendFormat(CultureConstants.DefaultCulture, "Total Skillpoints in Group: {0}{1}", skillGroup.TotalSP.ToString("#,##0"), Environment.NewLine);
            }

            result.AppendLine();
            result.AppendFormat(CultureConstants.DefaultCulture, "Total Skillpoints: {0}{1}", character.SkillPoints.ToString("#,##0"), Environment.NewLine);
            result.AppendFormat(CultureConstants.DefaultCulture, "Total Number of Skills: {0}{1}", character.KnownSkillCount.ToString().PadLeft(5), Environment.NewLine);
            result.AppendLine();
            result.AppendFormat(CultureConstants.DefaultCulture, "Skills at Level 0: {0}{1}", character.GetSkillCountAtLevel(0).ToString().PadLeft(5), Environment.NewLine);
            result.AppendFormat(CultureConstants.DefaultCulture, "Skills at Level 1: {0}{1}", character.GetSkillCountAtLevel(1).ToString().PadLeft(5), Environment.NewLine);
            result.AppendFormat(CultureConstants.DefaultCulture, "Skills at Level 2: {0}{1}", character.GetSkillCountAtLevel(2).ToString().PadLeft(5), Environment.NewLine);
            result.AppendFormat(CultureConstants.DefaultCulture, "Skills at Level 3: {0}{1}", character.GetSkillCountAtLevel(3).ToString().PadLeft(5), Environment.NewLine);
            result.AppendFormat(CultureConstants.DefaultCulture, "Skills at Level 4: {0}{1}", character.GetSkillCountAtLevel(4).ToString().PadLeft(5), Environment.NewLine);
            result.AppendFormat(CultureConstants.DefaultCulture, "Skills at Level 5: {0}{1}", character.GetSkillCountAtLevel(5).ToString().PadLeft(5), Environment.NewLine);

            return result.ToString();
        }
        /// <summary>
        /// Creates a XML format file for character exportation.
        /// </summary>
        /// <param name="character"></param>
        /// <param name="plan"></param>
        public static string ExportAsEVEMonXML(Character character, Plan plan)
        {
            var serial = character.Export();

            if (plan != null)
                serial.Skills = character.Skills.Where(x => x.IsKnown || (plan != null && plan.IsPlanned(x))).Select(x => GetMergedSkill(plan, x)).ToList();

            var doc = Util.SerializeToXmlDocument(serial.GetType(), serial);
            return Util.GetXMLStringRepresentation(doc);
        }
Exemple #22
0
        /// <summary>
        /// Displays the character exportation window and then exports it.
        /// </summary>
        /// <param name="character"></param>
        public static void ExportCharacter(Character character)
        {
            // Open the dialog box
            using(var characterSaveDialog = new SaveFileDialog())
            {
                characterSaveDialog.Title = "Save Character Info";
                characterSaveDialog.Filter = "Text Format|*.txt|CHR Format (EFT)|*.chr|HTML Format|*.html|XML Format (EVEMon)|*.xml|XML Format (CCP API)|*.xml|PNG Image|*.png";
                characterSaveDialog.FileName = character.Name;
                characterSaveDialog.FilterIndex = (int)CharacterSaveFormat.CCPXML;

                var result = characterSaveDialog.ShowDialog();
                if (result == DialogResult.Cancel) return;

                // Serialize
                try
                {
                    CharacterSaveFormat format = (CharacterSaveFormat)characterSaveDialog.FilterIndex;
                    // Save character with the chosen format to our file
                    FileHelper.OverwriteOrWarnTheUser(characterSaveDialog.FileName, fs =>
                    {
                        if (format == CharacterSaveFormat.PNG)
                        {
                            var monitor = Program.MainWindow.GetCurrentMonitor();
                            var bmp = monitor.GetCharacterScreenshot();
                            bmp.Save(fs, ImageFormat.Png);
                            return true;
                        }

                        var content = CharacterExporter.Export(format, character, null);
                        if ((format == CharacterSaveFormat.CCPXML) && string.IsNullOrEmpty(content))
                        {
                            MessageBox.Show("This character has never been downloaded from CCP, cannot find it in the XML cache.", "Cannot export the character", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            return false;
                        }

                        using (var sw = new StreamWriter(fs, Encoding.UTF8))
                        {
                            sw.Write(content);
                            sw.Flush();
                            sw.Close();
                        }
                        return true;
                    });
                }
                // Handle exception
                catch (IOException exc)
                {
                    ExceptionHandler.LogException(exc, true);
                    MessageBox.Show("A problem occurred during exportation. The operation has not been completed.");
                }
            }
        }
Exemple #23
0
        /// <summary>
        /// Displays the character exportation window and then exports it as it would be after the plan finish.
        /// </summary>
        /// <param name="character"></param>
        public static void ExportAfterPlanCharacter(Character character, Plan plan)
        {
            // Open the dialog box
            using (var characterSaveDialog = new SaveFileDialog())
            {
                characterSaveDialog.Title = "Save After Plan Character Info";
                characterSaveDialog.Filter = "Text Format|*.txt|CHR Format (EFT)|*.chr|HTML Format|*.html|XML Format (EVEMon)|*.xml";
                characterSaveDialog.FileName = String.Format(CultureConstants.DefaultCulture, " {0} (after plan {1})", character.Name, plan.Name);
                characterSaveDialog.FilterIndex = (int)CharacterSaveFormat.EVEMonXML;

                var result = characterSaveDialog.ShowDialog();
                if (result == DialogResult.Cancel)
                    return;
                
                // Serialize
                try
                {
                    // Save character to string with the chosen format
                    CharacterSaveFormat format = (CharacterSaveFormat)characterSaveDialog.FilterIndex;
                    var content = CharacterExporter.Export(format, character, plan);
                    // Save character with the chosen format to our file
                    FileHelper.OverwriteOrWarnTheUser(characterSaveDialog.FileName, fs =>
                    {
                        using (var sw = new StreamWriter(fs, Encoding.UTF8))
                        {
                            sw.Write(content);
                            sw.Flush();
                            sw.Close();
                        }
                        return true;
                    });
                }
                // Handle exception
                catch (IOException ex)
                {
                    ExceptionHandler.LogException(ex, true);
                    MessageBox.Show("A problem occurred during exportation. The operation has not been completed.");
                }
            }
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="character"></param>
 public QueuedSkillsEventArgs(Character character, IEnumerable<QueuedSkill> queuedSkills)
 {
     Character = character;
     CompletedSkills = new List<QueuedSkill>(queuedSkills).AsReadOnly();
 }
        /// <summary>
        /// Creates a XML format file for character exportation.
        /// </summary>
        /// <param name="character"></param>
        /// <param name="plan"></param>
        public static string ExportAsCCPXML(Character character)
        {
            // Try to use the last XML character sheet downloaded from CCP
            var doc = LocalXmlCache.GetCharacterXml(character.Name);
            if (doc != null)
                return Util.GetXMLStringRepresentation(doc);

            // Displays an error
            return null;
        }
        /// <summary>
        /// On load, update the controls states.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            m_character = (Character)m_plan.Character;
            m_characterScratchpad = m_plan.Character.After(m_plan.ChosenImplantSet);
            m_set = m_plan.ChosenImplantSet;

            // Set the min and max values of the NumericUpDown controls
            // based on character attributes value
            foreach (var control in AtrributesPanel.Controls)
            {
                NumericUpDown nud = control as NumericUpDown;

                if (nud == null)
                    continue;

                var attrib = (EveAttribute)(int.Parse((string)nud.Tag));
                nud.Minimum = m_character[attrib].EffectiveValue - m_character[attrib].ImplantBonus;
                nud.Maximum = (m_plan.ChosenImplantSet[attrib].Bonus > EveConstants.MaxImplantPoints ?
                                nud.Minimum + m_plan.ChosenImplantSet[attrib].Bonus :
                                nud.Minimum + EveConstants.MaxImplantPoints);
            }

            UpdateContent();
            base.OnLoad(e);
        }
        /// <summary>
        /// Creates a TXT format file for character exportation.
        /// </summary>
        /// <param name="character"></param>
        /// <param name="plan"></param>
        public static string ExportAsText(Character character, Plan plan)
        {
            string Separator = "=======================================================================";
            string SubSeparator = "-----------------------------------------------------------------------";

            StringBuilder builder = new StringBuilder();
            builder.AppendLine("BASIC INFO");
            builder.AppendLine(Separator);
            builder.AppendFormat(CultureConstants.DefaultCulture, "     Name: {0}{1}", character.Name, Environment.NewLine);
            builder.AppendFormat(CultureConstants.DefaultCulture, "   Gender: {0}{1}", character.Gender, Environment.NewLine);
            builder.AppendFormat(CultureConstants.DefaultCulture, "     Race: {0}{1}", character.Race, Environment.NewLine);
            builder.AppendFormat(CultureConstants.DefaultCulture, "Bloodline: {0}{1}", character.Bloodline, Environment.NewLine);
            builder.AppendFormat(CultureConstants.DefaultCulture, "  Balance: {0} ISK{1}", character.Balance.ToString("#,##0.00"), Environment.NewLine);
            builder.AppendLine();
            builder.AppendFormat(CultureConstants.DefaultCulture, "Intelligence: {0}{1}", character.Intelligence.EffectiveValue.ToString("#0.00").PadLeft(5), Environment.NewLine);
            builder.AppendFormat(CultureConstants.DefaultCulture, "    Charisma: {0}{1}", character.Charisma.EffectiveValue.ToString("#0.00").PadLeft(5), Environment.NewLine);
            builder.AppendFormat(CultureConstants.DefaultCulture, "  Perception: {0}{1}", character.Perception.EffectiveValue.ToString("#0.00").PadLeft(5), Environment.NewLine);
            builder.AppendFormat(CultureConstants.DefaultCulture, "      Memory: {0}{1}", character.Memory.EffectiveValue.ToString("#0.00").PadLeft(5), Environment.NewLine);
            builder.AppendFormat(CultureConstants.DefaultCulture, "   Willpower: {0}{1}", character.Willpower.EffectiveValue.ToString("#0.00").PadLeft(5), Environment.NewLine);
            builder.AppendLine();

            // Implants
            var implants = character.CurrentImplants.Where(x => x != Implant.None && (int)x.Slot < 5);
            if (implants.Count() > 0)
            {
                builder.AppendLine("IMPLANTS");
                builder.AppendLine(Separator);
                foreach (var implant in implants)
                {
                    builder.AppendFormat(CultureConstants.DefaultCulture, "+{0} {1} : {2}{3}", implant.Bonus, implant.Slot.ToString().PadRight(13), implant.Name, Environment.NewLine);
                }
                builder.AppendLine();
            }

            // Skill groups
            builder.AppendLine("SKILLS");
            builder.AppendLine(Separator);
            foreach (var skillGroup in character.SkillGroups)
            {
                int count = skillGroup.Where(x => x.IsKnown || (plan != null && plan.IsPlanned(x))).Select(x => GetMergedSkill(plan, x)).Count();
                int skillGroupTotalSP = skillGroup.Where(x => x.IsKnown || (plan != null && plan.IsPlanned(x))).Select(x=> GetMergedSkill(plan, x)).Sum(x=> x.Skillpoints);

                // Skill Group
                builder.AppendFormat(CultureConstants.DefaultCulture, "{0}, {1} Skill{2}, {3} Points{4}",
                             skillGroup.Name, count, count > 1 ? "s" : String.Empty,
                             skillGroupTotalSP.ToString("#,##0"), Environment.NewLine);

                // Skills
                foreach (var skill in skillGroup.Where(x => x.IsKnown || (plan != null && plan.IsPlanned(x))))
                {
                    var mergedSkill = GetMergedSkill(plan, skill);

                    string skillDesc = String.Format(CultureConstants.DefaultCulture, "{0} ({1})", skill.ToString(), skill.Rank.ToString());
                    builder.AppendFormat(CultureConstants.DefaultCulture, ": {0} L{1} {2}/{3} Points{4}",
                        skillDesc.PadRight(45), mergedSkill.Level.ToString().PadRight(5), mergedSkill.Skillpoints.ToString("#,##0"),
                        skill.StaticData.GetPointsRequiredForLevel(5).ToString("#,##0"), Environment.NewLine);

                    // If the skill is in training...
                    if (skill.IsTraining)
                    {
                        DateTime adjustedEndTime = character.CurrentlyTrainingSkill.EndTime.ToLocalTime();
                        builder.AppendFormat(CultureConstants.DefaultCulture, ":  (Currently training to level {0}, completes {1}){2}",
                                     Skill.GetRomanForInt(character.CurrentlyTrainingSkill.Level), adjustedEndTime, Environment.NewLine);
                    }
                }

                builder.AppendLine(SubSeparator);
            }

            return builder.ToString();
        }
Exemple #28
0
 /// <summary>
 /// Occurs whenever the current character changed (because of a button press or cycling).
 /// </summary>
 static void Lcdisplay_CurrentCharacterChanged(Character character)
 {
     Dispatcher.Invoke(() => UpdateOnTimerTick());
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="character"></param>
 public CharacterChangedEventArgs(Character character)
 {
     Character = character;
 }
Exemple #30
0
 /// <summary>
 /// Gets this skill's representation for the provided character
 /// </summary>
 /// <param name="character"></param>
 /// <returns></returns>
 public Skill ToCharacter(Character character)
 {
     return character.Skills[m_staticData.ArrayIndex];
 }