Exemplo n.º 1
0
        public virtual bool Remove(AbstractEffect effect)
        {
            int index = -1;

            lock (m_effects)
            {
                index = m_effects.IndexOf(effect);
                if (index < 0)
                {
                    return(false);
                }
                m_effects.RemoveAt(index);
            }

            if (index != -1)
            {
                effect.OnRemoved(m_owner);
                OnEffectsChanged(effect);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public virtual bool Remove(AbstractEffect effect)
        {
            int       num = -1;
            ArrayList effects;

            Monitor.Enter(effects = this.m_effects);
            try
            {
                num = this.m_effects.IndexOf(effect);
                if (num < 0)
                {
                    bool result = false;
                    return(result);
                }
                this.m_effects.RemoveAt(num);
            }
            finally
            {
                Monitor.Exit(effects);
            }
            if (num != -1)
            {
                effect.OnRemoved(this.m_owner);
                this.OnEffectsChanged(effect);
                return(true);
            }
            return(false);
        }
Exemplo n.º 3
0
        public virtual bool Remove(AbstractEffect effect)
        {
            int       index = -1;
            ArrayList effects;

            Monitor.Enter(effects = this.m_effects);
            bool result;

            try
            {
                index = this.m_effects.IndexOf(effect);
                if (index < 0)
                {
                    result = false;
                    return(result);
                }
                this.m_effects.RemoveAt(index);
            }
            finally
            {
                Monitor.Exit(effects);
            }
            if (index != -1)
            {
                effect.OnRemoved(this.m_owner);
                this.OnEffectsChanged(effect);
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
Exemplo n.º 4
0
        public virtual bool Remove(AbstractEffect effect)
        {
            int index = -1;
            lock (m_effects)
            {
                index = m_effects.IndexOf(effect);
                if (index < 0)
                    return false;
                m_effects.RemoveAt(index);
            }

            if (index != -1)
            {
                effect.OnRemoved(m_owner);
                OnEffectsChanged(effect);
                return true;
            }
            else
            {
                return false;
            }
        }