Пример #1
0
 public OwnerPeriod(Site site, DwarfObject newowner, int year, string cause)
 {
     Site = site; Owner = newowner; StartYear = year; StartCause = cause; EndYear = -1;
     if (Owner != null && Owner is Entity)
         ((Entity) Owner).AddOwnedSite(this);
     Site.OwnerHistory.Add(this);
 }
Пример #2
0
 public Duel(List<Property> properties, World world)
     : base(properties, world)
 {
     foreach (Property property in properties)
         switch (property.Name)
         {
             case "ordinal": Ordinal = String.Intern(property.Value); break;
             case "coords": Coordinates = Formatting.ConvertToLocation(property.Value); break;
             case "parent_eventcol": ParentCollection = world.GetEventCollection(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;
             case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;
             case "attacking_hfid": Attacker = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;
             case "defending_hfid": Defender = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;
         }
     //foreach (WorldEvent collectionEvent in Collection) this.AddEvent(collectionEvent);
     if (ParentCollection != null && ParentCollection.GetType() == typeof(Battle))
         foreach (HFDied death in Collection.OfType<HFDied>())
         {
             Battle battle = ParentCollection as Battle;
             if (battle.NotableAttackers.Contains(death.HistoricalFigure))
             {
                 battle.AttackerDeathCount++;
                 battle.Attackers.Single(squad => squad.Race == death.HistoricalFigure.Race).Deaths++;
                 (battle.ParentCollection as War).AttackerDeathCount++;
             }
             else if (battle.NotableDefenders.Contains(death.HistoricalFigure))
             {
                 battle.DefenderDeathCount++;
                 battle.Defenders.Single(squad => squad.Race == death.HistoricalFigure.Race).Deaths++;
                 (battle.ParentCollection as War).DefenderDeathCount++;
             }
             (ParentCollection.ParentCollection as War).DeathCount++;
         }
 }
Пример #3
0
 public OwnerPeriod(Site site, Entity newowner, int year, string cause)
 {
     Site = site; Owner = newowner; StartYear = year; StartCause = cause; EndYear = -1;
     if (Owner != null)
         Owner.AddOwnedSite(this);
     Site.OwnerHistory.Add(this);
 }
Пример #4
0
        public Theft(List<Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
                switch (property.Name)
                {
                    case "ordinal": Ordinal = String.Intern(property.Value); break;
                    case "coords": Coordinates = Formatting.ConvertToLocation(property.Value); break;
                    case "parent_eventcol": ParentCollection = world.GetEventCollection(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;
                    case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;
                    case "attacking_enid": Attacker = world.GetEntity(Convert.ToInt32(property.Value)); break;
                    case "defending_enid": Defender = world.GetEntity(Convert.ToInt32(property.Value)); break;
                }

            foreach (ItemStolen theft in Collection.OfType<ItemStolen>())
            {
                theft.Site = Site;
                Site.AddEvent(theft);
                Site.Events = Site.Events.OrderBy(ev => ev.ID).ToList();
                if (Attacker.SiteHistory.Count == 1)
                {
                    theft.ReturnSite = Attacker.SiteHistory.First().Site;
                    theft.ReturnSite.AddEvent(theft);
                    theft.ReturnSite.Events = theft.ReturnSite.Events.OrderBy(ev => ev.ID).ToList();
                }

            }
        }
Пример #5
0
 public Purge(List<Property> properties, World world)
     : base(properties, world)
 {
     foreach (Property property in properties)
     {
         switch (property.Name)
         {
             case "ordinal": Ordinal = String.Intern(property.Value); break;
             case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;
             case "adjective": Adjective = property.Value; break;
         }
     }
     Console.WriteLine();
 }
Пример #6
0
 public Abduction(List<Property> properties, World world)
     : base(properties, world)
 {
     foreach (Property property in properties)
         switch (property.Name)
         {
             case "ordinal": Ordinal = String.Intern(property.Value); break;
             case "coords": Coordinates = Formatting.ConvertToLocation(property.Value); break;
             case "parent_eventcol": ParentCollection = world.GetEventCollection(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;
             case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;
             case "attacking_enid": Attacker = world.GetEntity(Convert.ToInt32(property.Value)); break;
             case "defending_enid": Defender = world.GetEntity(Convert.ToInt32(property.Value)); break;
         }
 }
Пример #7
0
 public void AddConnection(Site connection)
 {
     if (!Connections.Contains(connection)) Connections.Add(connection);
 }
Пример #8
0
 public SitePrinter(Site site, World world)
 {
     Site = site;
     World = world;
 }
Пример #9
0
 private void ReadSite()
 {
     Site = World.GetSite(Convert.ToInt32(CurrentLine.Substring(0, CurrentLine.IndexOf(":"))));
     Site.UntranslatedName = Formatting.InitCaps(Formatting.ReplaceNonAscii(CurrentLine.Substring(CurrentLine.IndexOf(' ') + 1, CurrentLine.IndexOf(',') - CurrentLine.IndexOf(' ') - 1)));
     Owner = null;
     ReadLine();
 }
Пример #10
0
 public SiteNode(Site site) { Site = site; }