Пример #1
0
        public void addAbility(Ability ability)
        {
            //Remove the ability from any list it may be in.
            if (BasicAttacks.Contains(ability))
            {
                BasicAttacks.Remove(ability);
            }
            if (SpecialAttacks.Contains(ability))
            {
                SpecialAttacks.Remove(ability);
            }
            if (SpecialAbilities.Contains(ability))
            {
                SpecialAbilities.Remove(ability);
            }

            //Add the ability to the appropriate container.
            if (ability.Type == Ability.AbilityType.Basic)
            {
                BasicAttacks.Add(ability);
            }
            if (ability.Type == Ability.AbilityType.Special)
            {
                SpecialAttacks.Add(ability);
            }
            if (ability.Type == Ability.AbilityType.Ability || ability.Type == Ability.AbilityType.Passive)
            {
                SpecialAbilities.Add(ability);
            }

            //Update the character points
            updateCharacterPoints();
        }