public SiteTributeForced(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "attacker_civ_id": Attacker = world.GetEntity(Convert.ToInt32(property.Value)); break; case "defender_civ_id": Defender = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site_civ_id": SiteEntity = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break; } } Attacker.AddEvent(this); Defender.AddEvent(this); SiteEntity.AddEvent(this); Site.AddEvent(this); }
public HfAttackedSite(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "attacker_hfid": Attacker = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "defender_civ_id": DefenderCiv = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site_civ_id": SiteCiv = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break; } } Attacker.AddEvent(this); DefenderCiv.AddEvent(this); SiteCiv.AddEvent(this); Site.AddEvent(this); }
public AttackedSite(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "attacker_civ_id": Attacker = world.GetEntity(Convert.ToInt32(property.Value)); break; case "defender_civ_id": Defender = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site_civ_id": SiteEntity = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break; case "attacker_general_hfid": AttackerGeneral = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "defender_general_hfid": DefenderGeneral = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "attacker_merc_enid": AttackerMercenaries = world.GetEntity(Convert.ToInt32(property.Value)); break; case "defender_merc_enid": DefenderMercenaries = world.GetEntity(Convert.ToInt32(property.Value)); break; case "a_support_merc_enid": AttackerSupportMercenaries = world.GetEntity(Convert.ToInt32(property.Value)); break; case "d_support_merc_enid": DefenderSupportMercenaries = world.GetEntity(Convert.ToInt32(property.Value)); break; } } Attacker.AddEvent(this); if (Defender != Attacker) { Defender.AddEvent(this); } if (SiteEntity != Defender) { SiteEntity.AddEvent(this); } Site.AddEvent(this); if (AttackerGeneral != HistoricalFigure.Unknown) { AttackerGeneral.AddEvent(this); } if (DefenderGeneral != HistoricalFigure.Unknown) { DefenderGeneral.AddEvent(this); } if (AttackerMercenaries != Defender && AttackerMercenaries != Attacker) { AttackerMercenaries.AddEvent(this); } if (DefenderMercenaries != Defender && DefenderMercenaries != Attacker) { DefenderMercenaries.AddEvent(this); } AttackerSupportMercenaries.AddEvent(this); DefenderSupportMercenaries.AddEvent(this); }
public NewSiteLeader(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "attacker_civ_id": Attacker = world.GetEntity(Convert.ToInt32(property.Value)); break; case "defender_civ_id": Defender = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site_civ_id": SiteEntity = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break; case "new_site_civ_id": NewSiteEntity = world.GetEntity(Convert.ToInt32(property.Value)); break; case "new_leader_hfid": NewLeader = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; } } if (Site != null) { if (Site.OwnerHistory.Count == 0) { if (SiteEntity != null && SiteEntity != Defender) { SiteEntity.Parent = Defender; Site.OwnerHistory.Add(new OwnerPeriod(Site, SiteEntity, -1, "founded")); } else { Site.OwnerHistory.Add(new OwnerPeriod(Site, Defender, -1, "founded")); } } Site.OwnerHistory.Last().EndCause = "taken over"; Site.OwnerHistory.Last().EndYear = Year; Site.OwnerHistory.Last().Ender = Attacker; if (NewSiteEntity != null) { NewSiteEntity.Parent = Attacker; Site.OwnerHistory.Add(new OwnerPeriod(Site, NewSiteEntity, Year, "took over")); } } Attacker.AddEvent(this); Defender.AddEvent(this); if (SiteEntity != Defender) { SiteEntity.AddEvent(this); } Site.AddEvent(this); NewSiteEntity.AddEvent(this); NewLeader.AddEvent(this); }
public HfDestroyedSite(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "attacker_hfid": Attacker = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "defender_civ_id": DefenderCiv = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site_civ_id": SiteCiv = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break; } } Attacker.AddEvent(this); DefenderCiv.AddEvent(this); SiteCiv.AddEvent(this); Site.AddEvent(this); OwnerPeriod lastSiteOwnerPeriod = Site.OwnerHistory.LastOrDefault(); if (lastSiteOwnerPeriod != null) { lastSiteOwnerPeriod.EndYear = Year; lastSiteOwnerPeriod.EndCause = "destroyed"; lastSiteOwnerPeriod.Ender = Attacker; } if (DefenderCiv != null) { OwnerPeriod lastDefenderCivOwnerPeriod = DefenderCiv.SiteHistory.LastOrDefault(s => s.Site == Site); if (lastDefenderCivOwnerPeriod != null) { lastDefenderCivOwnerPeriod.EndYear = Year; lastDefenderCivOwnerPeriod.EndCause = "destroyed"; lastDefenderCivOwnerPeriod.Ender = Attacker; } } OwnerPeriod lastSiteCiveOwnerPeriod = SiteCiv.SiteHistory.LastOrDefault(s => s.Site == Site); if (lastSiteCiveOwnerPeriod != null) { lastSiteCiveOwnerPeriod.EndYear = Year; lastSiteCiveOwnerPeriod.EndCause = "destroyed"; lastSiteCiveOwnerPeriod.Ender = Attacker; } }
public DestroyedSite(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 "site_civ_id": SiteEntity = world.GetEntity(Convert.ToInt32(property.Value)); break; case "attacker_civ_id": Attacker = world.GetEntity(Convert.ToInt32(property.Value)); break; case "defender_civ_id": Defender = world.GetEntity(Convert.ToInt32(property.Value)); break; case "no_defeat_mention": NoDefeatMention = true; property.Known = true; break; } } if (Site.OwnerHistory.Count == 0) { if (SiteEntity != null && SiteEntity != Defender) { SiteEntity.Parent = Defender; Site.OwnerHistory.Add(new OwnerPeriod(Site, SiteEntity, -1, "founded")); } else { Site.OwnerHistory.Add(new OwnerPeriod(Site, Defender, -1, "founded")); } } Site.OwnerHistory.Last().EndCause = "destroyed"; Site.OwnerHistory.Last().EndYear = Year; Site.OwnerHistory.Last().Ender = Attacker; Site.AddEvent(this); if (SiteEntity != Defender) { SiteEntity.AddEvent(this); } Attacker.AddEvent(this); Defender.AddEvent(this); }
public FieldBattle(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "coords": Coordinates = Formatting.ConvertToLocation(property.Value); break; case "attacker_civ_id": Attacker = world.GetEntity(Convert.ToInt32(property.Value)); break; case "defender_civ_id": Defender = world.GetEntity(Convert.ToInt32(property.Value)); break; case "subregion_id": Region = world.GetRegion(Convert.ToInt32(property.Value)); break; case "attacker_general_hfid": AttackerGeneral = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "defender_general_hfid": DefenderGeneral = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "feature_layer_id": UndergroundRegion = world.GetUndergroundRegion(Convert.ToInt32(property.Value)); break; case "attacker_merc_enid": AttackerMercenaries = world.GetEntity(Convert.ToInt32(property.Value)); break; case "defender_merc_enid": DefenderMercenaries = world.GetEntity(Convert.ToInt32(property.Value)); break; case "a_support_merc_enid": AttackerSupportMercenaries = world.GetEntity(Convert.ToInt32(property.Value)); break; case "d_support_merc_enid": DefenderSupportMercenaries = world.GetEntity(Convert.ToInt32(property.Value)); break; } } Attacker.AddEvent(this); Defender.AddEvent(this); AttackerGeneral.AddEvent(this); DefenderGeneral.AddEvent(this); Region.AddEvent(this); UndergroundRegion.AddEvent(this); if (AttackerMercenaries != Defender && AttackerMercenaries != Attacker) { AttackerMercenaries.AddEvent(this); } if (DefenderMercenaries != Defender && DefenderMercenaries != Attacker) { DefenderMercenaries.AddEvent(this); } AttackerSupportMercenaries.AddEvent(this); DefenderSupportMercenaries.AddEvent(this); }