コード例 #1
0
        public SkillEffect GetCopyEffect(SkillEffect ef)
        {
            if (ef.Source == null)
            {
                return(null);
            }

            foreach (SkillEffect e in ActiveEffects)
            {
                if (ef.GetType().Name.Equals(e.GetType().Name) && ef.Source.Equals(e.Source))
                {
                    return(e);
                }
            }

            return(null);
        }
コード例 #2
0
        /// <summary>
        /// Returns true if this character already has a skilleffect of the parameter type
        /// </summary>
        public bool HasEffectAlready(SkillEffect ef)
        {
            if (ef.Source == null)
            {
                return(false);
            }

            foreach (SkillEffect e in ActiveEffects)
            {
                if (ef.GetType().Name.Equals(e.GetType().Name) && ef.Source.Equals(e.Source))
                {
                    return(true);
                }
            }

            return(false);
        }