Remove() public method

public Remove ( ITechTreeElement tte ) : void
tte ITechTreeElement
return void
        void ActorRemoved(Actor a)
        {
            if (a.Owner != Self.Owner || !a.Info.HasTraitInfo <SupportPowerInfo>())
            {
                return;
            }

            foreach (var t in a.TraitsImplementing <SupportPower>())
            {
                var key = MakeKey(t);
                Powers[key].Instances.Remove(t);

                if (Powers[key].Instances.Count == 0)
                {
                    Powers.Remove(key);

                    foreach (var prerequisite in t.Info.Prerequisites)
                    {
                        var techKey = key + prerequisite.Key;
                        TechTree.Remove(techKey);
                    }

                    TechTree.Update();
                }
            }
        }
Beispiel #2
0
        public void Unregister(Actor actor, GlobalUpgradable u, string[] prerequisites)
        {
            var key  = MakeKey(prerequisites);
            var list = upgradables[key];

            list.RemoveAll(x => x.First == actor && x.Second == u);
            if (!list.Any())
            {
                upgradables.Remove(key);
                techTree.Remove(key);
            }
        }
Beispiel #3
0
        void ActorRemoved(Actor a)
        {
            if (a.Owner != Self.Owner || !a.Info.HasTraitInfo<SupportPowerInfo>())
                return;

            foreach (var t in a.TraitsImplementing<SupportPower>())
            {
                var key = MakeKey(t);
                Powers[key].Instances.Remove(t);

                if (Powers[key].Instances.Count == 0 && !Powers[key].Disabled)
                {
                    Powers.Remove(key);
                    TechTree.Remove(key);
                    TechTree.Update();
                }
            }
        }