Beispiel #1
0
        IncumbentEffect FindIncumbent()
        {
            // Search for any incumbents on this host matching group
            LiveEffectBundle[] bundles = manager.EffectBundles;
            foreach (LiveEffectBundle bundle in bundles)
            {
                if (bundle.bundleType == ParentBundle.bundleType)
                {
                    foreach (IEntityEffect effect in bundle.liveEffects)
                    {
                        if (effect is IncumbentEffect)
                        {
                            // Effect must be flagged incumbent and agree with like-kind test
                            IncumbentEffect other = effect as IncumbentEffect;
                            if (other.IsIncumbent && other.IsLikeKind(this))
                            {
                                return(other);
                            }
                        }
                    }
                }
            }

            return(null);
        }