2017-10-04 22:51:12 +00:00
|
|
|
|
using System.Threading.Tasks;
|
2017-10-13 04:14:54 +00:00
|
|
|
|
using NadekoBot.Core.Services;
|
2017-10-04 22:51:12 +00:00
|
|
|
|
using System.Collections.Concurrent;
|
|
|
|
|
using NadekoBot.Modules.Gambling.Common.AnimalRacing;
|
|
|
|
|
|
|
|
|
|
namespace NadekoBot.Modules.Gambling.Services
|
|
|
|
|
{
|
|
|
|
|
public class AnimalRaceService : INService, IUnloadableService
|
|
|
|
|
{
|
|
|
|
|
public ConcurrentDictionary<ulong, AnimalRace> AnimalRaces { get; } = new ConcurrentDictionary<ulong, AnimalRace>();
|
|
|
|
|
|
|
|
|
|
public Task Unload()
|
|
|
|
|
{
|
|
|
|
|
foreach (var kvp in AnimalRaces)
|
|
|
|
|
{
|
|
|
|
|
try { kvp.Value.Dispose(); } catch { }
|
|
|
|
|
}
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|