Пример #1
0
        private string CreateNode(HistoricalFigure hf)
        {
            string classes = hf.Equals(_historicalFigure) ? " current" : "";

            string title = "";

            if (hf.Positions.Any())
            {
                title   += hf.GetLastNoblePosition();
                title   += "\\n--------------------\\n";
                classes += " leader";
            }
            title += hf.Race != _historicalFigure.Race ? hf.Race + " " : "";

            string description = "";

            if (hf.ActiveInteractions.Any(it => it.Contains("VAMPIRE")))
            {
                description += "Vampire ";
                classes     += " vampire";
            }
            if (hf.ActiveInteractions.Any(it => it.Contains("WEREBEAST")))
            {
                description += "Werebeast ";
                classes     += " werebeast";
            }
            if (hf.ActiveInteractions.Any(it => it.Contains("SECRET") && !it.Contains("ANIMATE")))
            {
                description += "Necromancer ";
                classes     += " necromancer";
            }
            if (hf.Ghost)
            {
                description += "Ghost ";
                classes     += " ghost";
            }
            description += !string.IsNullOrWhiteSpace(hf.AssociatedType) && hf.AssociatedType != "Standard" ? hf.AssociatedType : "";
            if (!string.IsNullOrWhiteSpace(description))
            {
                description += "\\n--------------------\\n";
            }
            title += description;
            title += hf.Name;
            if (!hf.Alive)
            {
                title   += "\\n✝";
                classes += " dead";
            }
            string node = "{ data: { id: '" + hf.Id + "', name: '" + WebUtility.HtmlEncode(title) + "', href: 'hf#" + hf.Id + "' , faveColor: '" + (hf.Caste == "Male" ? "#6FB1FC" : "#EDA1ED") + "' }, classes: '" + classes + "' },";

            return(node);
        }