Esempio n. 1
0
        //TODO: Check and possibly move logic
        public void AddOwnedSite(OwnerPeriod newSite)
        {
            if (newSite.StartCause == "UNKNOWN" && SiteHistory.Where(s => s.Site == newSite.Site).Count() == 0)
            {
                SiteHistory.Insert(0, newSite);
            }
            else
            {
                this.SiteHistory.Add(newSite);
            }

            if (newSite.Owner != this)
            {
                this.Groups.Add((Entity)newSite.Owner);
            }
            if (this.Parent != null && this.Parent != null)
            {
                Parent.AddOwnedSite(newSite);
                this.Race = Parent.Race;
            }
        }
Esempio n. 2
0
        //TODO: Check and possibly move logic
        public void AddOwnedSite(OwnerPeriod ownerPeriod)
        {
            if (ownerPeriod.StartCause == "UNKNOWN" && SiteHistory.All(s => s.Site != ownerPeriod.Site))
            {
                SiteHistory.Insert(0, ownerPeriod);
            }
            else
            {
                SiteHistory.Add(ownerPeriod);
            }

            if (ownerPeriod.Owner != this)
            {
                Groups.Add((Entity)ownerPeriod.Owner);
            }

            if (!IsCiv && Parent != null)
            {
                Parent.AddOwnedSite(ownerPeriod);
                Race = Parent.Race;
            }
        }