Currency Raffle almost done.
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
using NadekoBot.Core.Services;
|
||||
using Discord;
|
||||
using NadekoBot.Common;
|
||||
using NadekoBot.Core.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -8,33 +11,24 @@ namespace NadekoBot.Core.Modules.Gambling.Common
|
||||
{
|
||||
public class CurrencyRaffleGame
|
||||
{
|
||||
private readonly HashSet<(string, ulong)> _users = new HashSet<(string, ulong)>();
|
||||
private readonly HashSet<IUser> _users = new HashSet<IUser>();
|
||||
public IEnumerable<IUser> Users => _users;
|
||||
private readonly int _amount;
|
||||
private readonly CurrencyService _cs;
|
||||
private readonly DbService _db;
|
||||
private bool running;
|
||||
|
||||
public CurrencyRaffleGame(int amount, CurrencyService cs, DbService db)
|
||||
public CurrencyRaffleGame(int amount)
|
||||
{
|
||||
if (amount < 1)
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
||||
_amount = amount;
|
||||
_cs = cs;
|
||||
_db = db;
|
||||
}
|
||||
|
||||
public async Task<bool> AddUser(string username, ulong userId)
|
||||
public bool AddUser(IUser usr)
|
||||
{
|
||||
if (!_users.Add(usr))
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public void ForceStop()
|
||||
{
|
||||
lock (_locker)
|
||||
{
|
||||
running = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user