Ejemplo n.º 1
0
        public string Print(bool link = true, DwarfObject pov = null, WorldEvent worldEvent = null)
        {
            var identityString = "the ";

            if (Race != null && Race != CreatureInfo.Unknown)
            {
                identityString += Race.NameSingular.ToLower();
            }
            else
            {
                identityString += HistoricalFigure.GetRaceString();
            }

            if (!string.IsNullOrWhiteSpace(Profession))
            {
                identityString += " " + Profession.ToLower();
            }
            var icon = !string.IsNullOrWhiteSpace(Caste) ? GetIcon() : HistoricalFigure.GetIcon();

            if (!string.IsNullOrWhiteSpace(icon))
            {
                identityString += " " + icon;
            }
            identityString += " " + Name;
            if (Entity != null)
            {
                identityString += " of ";
                identityString += Entity.ToLink(link, pov, worldEvent);
            }
            return(identityString);
        }
Ejemplo n.º 2
0
 public void CheckSiteOwnership()
 {
     //Check if a site was gained without a proper event from the xml
     if (Owner != null)
     {
         if (Site.OwnerHistory.Count == 0)
         {
             new OwnerPeriod(Site, Owner, 1, "founded");
         }
         else if (Site.OwnerHistory.Last().Owner != Owner)
         {
             bool             found          = false;
             HistoricalFigure lastKnownOwner = Site.OwnerHistory.Last().Owner as HistoricalFigure;
             if (lastKnownOwner != null)
             {
                 if (lastKnownOwner.DeathYear != -1)
                 {
                     new OwnerPeriod(Site, Owner, lastKnownOwner.DeathYear, "after death of last owner (" + lastKnownOwner.DeathCause + ") took over");
                     found = true;
                 }
                 else if (lastKnownOwner.Race == "Demon" && Site.Type == "Vault" && Owner is Entity && Owner.Race == "Unknown")
                 {
                     // SPOILER Devil owns the place, Entity is a group of angles
                     found = true;
                 }
             }
             else if (Site.CurrentOwner == null)
             {
                 new OwnerPeriod(Site, Owner, Site.OwnerHistory.Last().EndYear, "slowly repopulated after the site was " + Site.OwnerHistory.Last().EndCause);
                 found = true;
             }
             if (!found)
             {
                 ChangeHFState lastSettledEvent = Site.Events.OfType <ChangeHFState>().LastOrDefault();
                 if (lastSettledEvent != null)
                 {
                     new OwnerPeriod(Site, Owner, lastSettledEvent.Year, "settled in ");
                 }
                 else
                 {
                     World.ParsingErrors.Report("Site ownership conflict: " + Site.Name + ". Actually owned by " + Owner.ToLink(false) + " instead of " + Site.OwnerHistory.Last().Owner.ToLink(false));
                 }
             }
         }
     }
     //check for loss of period ownership, since some some loss of ownership eventsList are missing
     if (Owner == null && Site.OwnerHistory.Count > 0 && Site.OwnerHistory.Last().EndYear == -1)
     {
         Site.OwnerHistory.Last().EndYear  = World.Events.Last().Year - 1;
         Site.OwnerHistory.Last().EndCause = "UNKNOWN";
     }
 }
Ejemplo n.º 3
0
        public void CheckSiteOwnership()
        {
            //Check if a site was gained without a proper event from the xml
            if (Owner != null)
            {
                if (Site.OwnerHistory.Count == 0)
                {
                    new OwnerPeriod(Site, Owner, 1, "UNKNOWN");
                }
                else if (Site.OwnerHistory.Last().Owner != Owner)
                {
                    World.ParsingErrors.Report("Site ownership conflict: " + Site.Name + ". Actually owned by " + Owner.ToLink(false));
                }
            }

            //check for loss of period ownership, since some some loss of ownership eventsList are missing
            if (Owner == null && Site.OwnerHistory.Count > 0 && Site.OwnerHistory.Last().EndYear == -1)
            {
                Site.OwnerHistory.Last().EndYear  = World.Events.Last().Year - 1;
                Site.OwnerHistory.Last().EndCause = "UNKNOWN";
            }
        }