/// <summary> /// This method is tied to the ProgressChanged events in the AchievementConditions of this Achievement /// </summary> /// <param name="sender">IAchievementCondition thath fired the event</param> /// <param name="args">Parameters that are important for this event</param> private void ConditionProgressChanged(IAchievementCondition sender, AchievementConditionProgressChangedArgs args) { if (sender.Unlocked) { return; } // Calculate overall progress of Achievement based on progress of AchievementConditions Progress = Conditions.Sum(condition => condition.Progress) / Conditions.Count(); InvokeProgressChanged(Progress); }
/// <summary> /// This method is tied to the ProgressChanged events in the AchievementConditions of this Achievement /// </summary> /// <param name="sender">IAchievementCondition thath fired the event</param> /// <param name="args">Parameters that are important for this event</param> private void ConditionProgressChanged(IAchievementCondition sender, AchievementConditionProgressChangedArgs args) { if (sender.Unlocked) return; // Calculate overall progress of Achievement based on progress of AchievementConditions Progress = Conditions.Sum(condition => condition.Progress) / Conditions.Count(); InvokeProgressChanged(Progress); }