public override string Print(bool link = true, DwarfObject pov = null) { string eventString = GetYearTime(); eventString += Changer?.ToLink(link, pov, this) ?? "An unknown creature"; eventString += " changed "; eventString += Changee?.ToLink(link, pov, this) ?? "an unknown creature"; eventString += " from "; eventString += Formatting.AddArticle(OldRace).ToLower(); eventString += " into "; eventString += Formatting.AddArticle(NewRace).ToLower(); eventString += PrintParentCollection(link, pov); eventString += "."; return(eventString); }
public ChangedCreatureType(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "old_race": OldRace = Formatting.FormatRace(property.Value); break; case "old_caste": OldCaste = property.Value; break; case "new_race": NewRace = Formatting.FormatRace(property.Value); break; case "new_caste": NewCaste = property.Value; break; case "changee_hfid": Changee = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "changer_hfid": Changer = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "changee": if (Changee == null) { Changee = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; case "changer": if (Changer == null) { Changer = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; } } Changee.PreviousRace = OldRace; Changee.CreatureTypes.Add(new HistoricalFigure.CreatureType(NewRace, this)); Changee.AddEvent(this); Changer.AddEvent(this); }