Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="character"></param>
        public static string ExportAsBBCode(Character character)
        {
            StringBuilder result = new StringBuilder();

            result.AppendLine("[b]" + character.Name + "[/b]");
            result.AppendLine("");
            result.AppendLine("[b]Attributes[/b]");
            result.AppendLine("Intelligence: " + character.Intelligence.EffectiveValue.ToString("#0.00").PadLeft(5));
            result.AppendLine("Perception: " + character.Perception.EffectiveValue.ToString("#0.00").PadLeft(5));
            result.AppendLine("Charisma: " + character.Charisma.EffectiveValue.ToString("#0.00").PadLeft(5));
            result.AppendLine("Willpower: " + character.Willpower.EffectiveValue.ToString("#0.00").PadLeft(5));
            result.AppendLine("Memory: " + character.Memory.EffectiveValue.ToString("#0.00").PadLeft(5));

            foreach (var skillGroup in character.SkillGroups)
            {
                result.AppendLine("");
                result.AppendLine("[b]" + skillGroup.Name + "[/b]");

                foreach (var skill in skillGroup)
                {
                    string url = String.Format("[img]{0}{1}.gif[/img]", NetworkConstants.MyEVELevelImage, skill.Level);
                    result.AppendLine(String.Format("{0} {1}", url, skill.Name));
                }

                result.AppendLine("Total Skillpoints in Group: " + skillGroup.TotalSP.ToString("#,##0"));
            }

            result.AppendLine("");
            result.AppendLine("Total Skillpoints: " + character.SkillPoints.ToString("#,##0"));
            result.AppendLine("Total Number of Skills: " + character.KnownSkillCount.ToString());
            result.AppendLine("");
            result.AppendLine("Skills at Level 1: " + character.GetSkillCountAtLevel(1).ToString());
            result.AppendLine("Skills at Level 2: " + character.GetSkillCountAtLevel(2).ToString());
            result.AppendLine("Skills at Level 3: " + character.GetSkillCountAtLevel(3).ToString());
            result.AppendLine("Skills at Level 4: " + character.GetSkillCountAtLevel(4).ToString());
            result.AppendLine("Skills at Level 5: " + character.GetSkillCountAtLevel(5).ToString());

            return(result.ToString());
        }
        /// <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();
        }
Example #3
0
        /// <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>
        /// 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();
        }