public void Start(int ID) { IRunChallenge?chall = _ActiveChallenges.FirstOrDefault(iter => iter.ID == ID); if (chall == null) { _Logger.LogWarning($"Cannot start challenge {ID}, is not active, or does not exist"); return; } IndexedChallenge?running = _RunningChallenges.FirstOrDefault(iter => iter.Challenge.ID == ID); if (running != null) { _Logger.LogWarning($"Not adding repeat challenge {chall.ID}/{chall.Name}"); return; } IndexedChallenge newChall = new IndexedChallenge(chall); _RunningChallenges.Add(newChall); _Logger.LogInformation($"Started new challenge {newChall.Challenge.ID}/{newChall.Challenge.Name}, index {newChall.Index}"); _ChallengeEvents.EmitChallengeStart(newChall); }
public void EmitChallengeEnded(IndexedChallenge challenge) { OnChallengeEnded?.Invoke(this, new Ps2EventArgs <IndexedChallenge>(challenge)); }