void CheckForLMVPointEvents() { var pointsGained = 0; var lmvSettings = Settings.BibaPointSettings.Where(setting => setting is BibaLMVPointEvent); foreach (BibaLMVPointEvent setting in lmvSettings) { if (!BibaProfile.BibaProfileSession.CompletedLMVScoreEvents.Contains(setting.Id) || setting.Repeat) { if (BibaProfile.BibaProfileSession.LMVSessionDict [setting.LMVScoreType].SessionScore >= setting.ScoreRequired) { BibaProfile.Points += setting.Points; if (!BibaProfile.BibaProfileSession.CompletedLMVScoreEvents.Contains(setting.Id)) { BibaProfile.BibaProfileSession.CompletedLMVScoreEvents.Add(setting.Id); } } } } if (pointsGained > 0) { DataService.Save(); PointsGainedSignal.Dispatch(pointsGained, BibaProfile.Points); } }
public void CheckAndCompletePointEvent(string keyToCheck) { var setting = Settings.BibaPointSettings.Find(sett => sett.Id == keyToCheck); if (setting == null) { return; } if (!BibaProfile.CompletedPointEvents.Contains(keyToCheck) || setting.Repeat) { BibaProfile.Points += setting.Points; if (!BibaProfile.CompletedPointEvents.Contains(keyToCheck)) { BibaProfile.CompletedPointEvents.Add(keyToCheck); } DataService.Save(); PointsGainedSignal.Dispatch(setting.Points, BibaProfile.Points); } CheckForLMVPointEvents(); }