public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } SecondarySkillLevel otherObj = (SecondarySkillLevel)obj; return(Value == otherObj.Value); }
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; } }