public AgreementMade(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 "topic": switch (property.Value) { case "treequota": Topic = AgreementTopic.TreeQuota; break; case "becomelandholder": Topic = AgreementTopic.BecomeLandHolder; break; case "promotelandholder": Topic = AgreementTopic.PromoteLandHolder; break; case "tributeagreement": Topic = AgreementTopic.Tribute; break; case "unknown 9": Topic = AgreementTopic.Tribute; break; default: Topic = AgreementTopic.Unknown; property.Known = false; break; } break; case "source": Source = world.GetEntity(Convert.ToInt32(property.Value)); break; case "destination": Destination = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site": if (Site == null) { Site = world.GetSite(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; } } Site.AddEvent(this); Source.AddEvent(this); if (Source != Destination) { Destination.AddEvent(this); } }
public AgreementRejected(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 "topic": switch (property.Value) { case "treequota": Topic = AgreementTopic.TreeQuota; break; case "becomelandholder": Topic = AgreementTopic.BecomeLandHolder; break; case "promotelandholder": Topic = AgreementTopic.PromoteLandHolder; break; default: Topic = AgreementTopic.Unknown; world.ParsingErrors.Report("Unknown Agreement Topic: " + property.Value); break; } break; case "source": Source = world.GetEntity(Convert.ToInt32(property.Value)); break; case "destination": Destination = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site": if (Site == null) { Site = world.GetSite(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; } } Site.AddEvent(this); Source.AddEvent(this); Destination.AddEvent(this); }