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); }
/// <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); }