public SneakIntoSite(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": SiteCiv = world.GetEntity(Convert.ToInt32(property.Value)); break; case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break; } } Attacker.AddEvent(this); Defender.AddEvent(this); SiteCiv.AddEvent(this); Site.AddEvent(this); }
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; case "season": Season = property.Value; break; } } Attacker.AddEvent(this); Defender.AddEvent(this); if (SiteEntity != Defender) { SiteEntity.AddEvent(this); } Site.AddEvent(this); }