예제 #1
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            SecondarySkillLevel otherObj = (SecondarySkillLevel)obj;

            return(Value == otherObj.Value);
        }
예제 #2
0
        public void SetLevelForSecondarySkillType(Type secondarySkillType, SecondarySkillLevel level)
        {
            SecondarySkill skill = ExistingSecondarySkillOfType(secondarySkillType);

            if (level == SecondarySkillLevel.None)
            {
                if (skill != null)
                {
                    SecondarySkills.Remove(skill);
                }
            }
            else
            {
                if (skill == null)
                {
                    skill           = (SecondarySkill)Activator.CreateInstance(secondarySkillType);
                    skill.HeroStats = this;
                    SecondarySkills.Add(skill);
                }

                skill.SkillLevel = level;
            }
        }