Beispiel #1
0
        private void PrintSkills()
        {
            if (_historicalFigure.Skills.Count > 0)
            {
                var described = _historicalFigure.Skills.ConvertAll(s => SkillDictionary.LookupSkill(s));

                Html.AppendLine(Bold("Skills") + LineBreak);

                foreach (var group in described.Where(d => d.Category != "non").GroupBy(d => d.Category).OrderByDescending(g => g.Count()))
                {
                    Html.AppendLine("<ol class='skills'>");

                    foreach (var desc in group.OrderByDescending(d => d.Points))
                    {
                        Html.AppendLine(SkillToString(desc));
                    }

                    Html.AppendLine("</ol>");
                }

                Html.AppendLine(LineBreak);
            }
        }
Beispiel #2
0
        public string Print(bool withHonoredHfs = false)
        {
            string html = "";

            html += Name;
            if (RequiredSkill != null)
            {
                html += "<br/>";
                html += "<ol class='skills'>";
                html += HtmlPrinter.SkillToString(SkillDictionary.LookupSkill(RequiredSkill));
                html += "</ol>";
            }

            if (RequiredBattles > 0 || RequiredYears > 0 || RequiredKills > 0 || GivesPrecedence > 0 || GrantedToEverybody || RequiresAnyMeleeOrRangedSkill)
            {
                html += "<br/>";
                html += "<ul>";
                if (GivesPrecedence > 0)
                {
                    html += "<li>";
                    html += "Gives Precedence: " + GivesPrecedence;
                    html += "</li>";
                }
                if (RequiredBattles > 0)
                {
                    html += "<li>";
                    html += "Required Battles: " + RequiredBattles;
                    html += "</li>";
                }
                if (RequiredYears > 0)
                {
                    html += "<li>";
                    html += "Required Years: " + RequiredYears;
                    html += "</li>";
                }
                if (RequiredKills > 0)
                {
                    html += "<li>";
                    html += "Required Kills: " + RequiredKills;
                    html += "</li>";
                }

                if (GrantedToEverybody)
                {
                    html += "<li>";
                    html += "Granted to everybody";
                    html += "</li>";
                }
                if (RequiresAnyMeleeOrRangedSkill)
                {
                    html += "<li>";
                    html += "Requires any melee or ranged skill";
                    html += "</li>";
                }
                html += "</ul>";
            }

            if (withHonoredHfs)
            {
                if (HonoredHfs.Any())
                {
                    html += "<ul>";
                    html += "<li><b>Honored Historical Figures:</b></li>";
                    html += "<ul>";
                    foreach (HistoricalFigure honoredHf in HonoredHfs)
                    {
                        html += "<li>";
                        html += honoredHf.ToLink();
                        html += "</li>";
                    }
                    html += "</ul>";
                    html += "</ul>";
                }
            }
            return(html);
        }