public async Task Unload() { _t.Change(Timeout.Infinite, Timeout.Infinite); AcrophobiaGames.ForEach(x => x.Value.Dispose()); AcrophobiaGames.Clear(); HangmanGames.ForEach(x => x.Value.Dispose()); HangmanGames.Clear(); await Task.WhenAll(RunningTrivias.Select(x => x.Value.StopGame())).ConfigureAwait(false); RunningTrivias.Clear(); TicTacToeGames.Clear(); await Task.WhenAll(RunningContests.Select(x => x.Value.Stop())) .ConfigureAwait(false); RunningContests.Clear(); NunchiGames.ForEach(x => x.Value.Dispose()); NunchiGames.Clear(); }
public async Task Unload() { _t.Change(Timeout.Infinite, Timeout.Infinite); _cmd.OnMessageNoTrigger -= PotentialFlowerGeneration; AcrophobiaGames.ForEach(x => x.Value.Dispose()); AcrophobiaGames.Clear(); Connect4Games.ForEach(x => x.Value.Dispose()); Connect4Games.Clear(); HangmanGames.ForEach(x => x.Value.Dispose()); HangmanGames.Clear(); await Task.WhenAll(RunningTrivias.Select(x => x.Value.StopGame())); RunningTrivias.Clear(); TicTacToeGames.Clear(); await Task.WhenAll(RunningContests.Select(x => x.Value.Stop())) .ConfigureAwait(false); RunningContests.Clear(); NunchiGames.ForEach(x => x.Value.Dispose()); NunchiGames.Clear(); }