Esempio n. 1
0
        private void PrintTitle()
        {
            Html.AppendLine("<h1>" + _historicalFigure.GetIcon() + " " + _historicalFigure.Name + "</h1>");
            string title = string.Empty;

            if (_historicalFigure.Deity)
            {
                title = "Is a deity";
                if (_historicalFigure.WorshippedBy != null)
                {
                    title += " that occurs in the myths of " + _historicalFigure.WorshippedBy.ToLink() + ". ";
                }
                else
                {
                    title += ". ";
                }

                title += _historicalFigure.ToLink(false, _historicalFigure) + " is most often depicted as " + _historicalFigure.GetRaceTitleString() + ". ";
            }
            else if (_historicalFigure.Force)
            {
                title = "Is a force said to permeate nature. ";
                if (_historicalFigure.WorshippedBy != null)
                {
                    title += "Worshipped by " + _historicalFigure.WorshippedBy.ToLink();
                }
            }
            else
            {
                if (_historicalFigure.DeathYear >= 0)
                {
                    title += "Was " + _historicalFigure.GetRaceTitleString();
                }
                else
                {
                    title += "Is " + _historicalFigure.GetRaceTitleString();
                }
                title += " born in " + _historicalFigure.BirthYear;

                if (_historicalFigure.DeathYear > 0)
                {
                    HfDied death = _historicalFigure.Events.OfType <HfDied>().First(hfDeath => hfDeath.HistoricalFigure == _historicalFigure);
                    title += " and died in " + _historicalFigure.DeathYear + " (" + death.Cause.GetDescription() + ")";
                    if (death.Slayer != null)
                    {
                        title += " by " + death.Slayer.ToLink();
                    }
                    else if (death.SlayerRace != "UNKNOWN" && death.SlayerRace != "-1")
                    {
                        title += " by a " + death.SlayerRace.ToLower();
                    }

                    if (death.ParentCollection != null)
                    {
                        title += ", " + death.PrintParentCollection();
                    }
                }
                if (!title.EndsWith(". "))
                {
                    title += ". ";
                }
            }
            Html.AppendLine("<b>" + title + "</b></br>");
            if (!string.IsNullOrWhiteSpace(_historicalFigure.Caste) && _historicalFigure.Caste != "Default")
            {
                Html.AppendLine("<b>Caste:</b> " + _historicalFigure.Caste + "</br>");
            }
            if (!string.IsNullOrWhiteSpace(_historicalFigure.AssociatedType) && _historicalFigure.AssociatedType != "Standard")
            {
                Html.AppendLine("<b>Type:</b> " + _historicalFigure.AssociatedType + "</br>");
            }
        }