/// <summary> /// Add given ability to list of available abilities. /// If given ability is a duplicate of an already available ability then that /// ability has it's rank increased /// </summary> /// <param name="activeAbilityToAddArg"></param> public void AddActiveAbility(ActiveAbility activeAbilityToAddArg) { //get acquired ability that matches given ability ActiveAbility matchedAcquiredAbility = activeAbilities.FirstOrDefault( iterAbility => iterAbility.abilityId == activeAbilityToAddArg.abilityId); //if already have acquired the given ability if (matchedAcquiredAbility != null) { //increase rank of matched ability matchedAcquiredAbility.PromoteAbilityRank(); } //else does NOT yet have the given ability else { //add ability to list of available abilities activeAbilities.Add(activeAbilityToAddArg); //equip new ability to a quick slot that does NOT already have an ability assigned to it EquipAbilityToVacantQuickSlot(activeAbilities.Count - 1); } }