예제 #1
0
 /// <summary>
 /// Casts the selected IAbility. Returns whether or not the IAbility succeeded.
 /// </summary>
 /// <param name="cast"> The IAbility to cast. </param>
 /// <param name="enemyTargets"> The enemies that this IAbility will target. </param>
 /// <param name="allyTargets"> The allies that this IAbility will target. </param>
 /// <returns></returns>
 public bool CastAbility(IAbility cast, Character[] enemyTargets, Character[] allyTargets)
 {
     // First, pay the cost.
     if (PayAbilityCost(cast.Cost))
     {
         // Then, activate the IAbility if the cost can be paid.
         return(cast.Activate(this, enemyTargets, allyTargets));
     }
     return(false);
 }