public HfsFormedReputationRelationship(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "hfid1": HistoricalFigure1 = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "hfid2": HistoricalFigure2 = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "identity_id1": IdentityId1 = Convert.ToInt32(property.Value); break; case "identity_id2": IdentityId2 = Convert.ToInt32(property.Value); break; case "hf_rep_1_of_2": switch (property.Value) { case "information source": HfRep1Of2 = ReputationType.InformationSource; break; default: property.Known = false; break; } break; case "hf_rep_2_of_1": switch (property.Value) { case "information source": HfRep2Of1 = ReputationType.InformationSource; break; case "buddy": HfRep2Of1 = ReputationType.Buddy; break; default: property.Known = false; break; } break; 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; } } HistoricalFigure1.AddEvent(this); HistoricalFigure2.AddEvent(this); Site.AddEvent(this); Region.AddEvent(this); UndergroundRegion.AddEvent(this); }
public override string Print(bool link = true, DwarfObject pov = null) { string eventString = GetYearTime(); eventString += HistoricalFigure1.ToLink(link, pov, this); Identity identity1 = HistoricalFigure1?.Identities.FirstOrDefault(i => i.Id == IdentityId1); if (identity1 != null) { eventString += " as '" + identity1.Print(link, pov, this) + "'"; } eventString += ", formed a false friendship with "; eventString += HistoricalFigure2.ToLink(link, pov, this); Identity identity2 = HistoricalFigure2?.Identities.FirstOrDefault(i => i.Id == IdentityId2); if (identity2 != null) { eventString += " as '" + identity2.Print(link, pov, this) + "'"; } if (HfRep2Of1 == ReputationType.Buddy || HfRep2Of1 == ReputationType.Friendly) { eventString += " in order to extract information"; } else if (HfRep2Of1 == ReputationType.InformationSource) { eventString += " where each used the other for information"; } eventString += " in "; if (Site != null) { eventString += Site.ToLink(link, pov, this); } else if (Region != null) { eventString += Region.ToLink(link, pov, this); } else if (UndergroundRegion != null) { eventString += UndergroundRegion.ToLink(link, pov, this); } else { eventString += "UNKNOWN LOCATION"; } eventString += PrintParentCollection(link, pov); eventString += "."; return(eventString); }
public override string Print(bool link = true, DwarfObject pov = null) { string eventString = GetYearTime(); eventString += HistoricalFigure1.ToLink(link, pov); if (IdentityId1 > 0) { eventString += " as '" + IdentityId1 + "'"; } eventString += ", formed a false friendship with "; eventString += HistoricalFigure2.ToLink(link, pov); if (IdentityId2 > 0) { eventString += " as '" + IdentityId2 + "'"; } if (HfRep2Of1 == ReputationType.Buddy) { eventString += " in order to extract information"; } else if (HfRep2Of1 == ReputationType.InformationSource) { eventString += " where each used the other for information"; } eventString += " in "; if (Site != null) { eventString += Site.ToLink(link, pov); } else if (Region != null) { eventString += Region.ToLink(link, pov); } else if (UndergroundRegion != null) { eventString += UndergroundRegion.ToLink(link, pov); } else { eventString += "UNKNOWN LOCATION"; } eventString += PrintParentCollection(link, pov); eventString += "."; return(eventString); }