Пример #1
0
        public HfRelationShipDenied(List <Property> properties, World world) : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "site_id":
                    Site = world.GetSite(Convert.ToInt32(property.Value));
                    break;

                case "subregion_id":
                    Region = world.GetRegion(Convert.ToInt32(property.Value));
                    break;

                case "feature_layer_id":
                    UndergroundRegion = world.GetUndergroundRegion(Convert.ToInt32(property.Value));
                    break;

                case "seeker_hfid":
                    Seeker = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    break;

                case "target_hfid":
                    Target = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    break;

                case "relationship":
                    Relationship = property.Value;
                    break;

                case "reason":
                    Reason = property.Value;
                    break;

                case "reason_id":
                    ReasonHf = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    break;
                }
            }

            Site.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
            Seeker.AddEvent(this);
            Target.AddEvent(this);
            if (ReasonHf != null && !ReasonHf.Equals(Seeker) && !ReasonHf.Equals(Target))
            {
                ReasonHf.AddEvent(this);
            }
        }
Пример #2
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);
        }