public Trade(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "trader_hfid": Trader = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "trader_entity_id": TraderEntity = world.GetEntity(Convert.ToInt32(property.Value)); break; case "source_site_id": SourceSite = world.GetSite(Convert.ToInt32(property.Value)); break; case "dest_site_id": DestSite = world.GetSite(Convert.ToInt32(property.Value)); break; case "production_zone_id": ProductionZoneId = Convert.ToInt32(property.Value); break; case "allotment": Allotment = Convert.ToInt32(property.Value); break; case "allotment_index": AllotmentIndex = Convert.ToInt32(property.Value); break; case "account_shift": AccountShift = Convert.ToInt32(property.Value); break; } } SourceSite.AddEvent(this); DestSite.AddEvent(this); Trader.AddEvent(this); TraderEntity.AddEvent(this); }