2017-10-20 03:55:14 +00:00
|
|
|
|
using Discord;
|
|
|
|
|
using NadekoBot.Common;
|
|
|
|
|
using NadekoBot.Core.Services;
|
2017-10-19 12:10:22 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2017-10-20 03:55:14 +00:00
|
|
|
|
using System.Linq;
|
2017-10-19 12:10:22 +00:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace NadekoBot.Core.Modules.Gambling.Common
|
|
|
|
|
{
|
|
|
|
|
public class CurrencyRaffleGame
|
|
|
|
|
{
|
2017-10-20 03:55:14 +00:00
|
|
|
|
private readonly HashSet<IUser> _users = new HashSet<IUser>();
|
|
|
|
|
public IEnumerable<IUser> Users => _users;
|
2017-10-19 12:10:22 +00:00
|
|
|
|
private readonly int _amount;
|
|
|
|
|
|
2017-10-20 03:55:14 +00:00
|
|
|
|
public CurrencyRaffleGame(int amount)
|
2017-10-19 12:10:22 +00:00
|
|
|
|
{
|
|
|
|
|
if (amount < 1)
|
|
|
|
|
throw new ArgumentOutOfRangeException();
|
|
|
|
|
|
|
|
|
|
_amount = amount;
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-20 03:55:14 +00:00
|
|
|
|
public bool AddUser(IUser usr)
|
2017-10-19 12:10:22 +00:00
|
|
|
|
{
|
2017-10-20 03:55:14 +00:00
|
|
|
|
if (!_users.Add(usr))
|
|
|
|
|
return false;
|
2017-10-19 12:10:22 +00:00
|
|
|
|
|
2017-10-20 03:55:14 +00:00
|
|
|
|
return true;
|
2017-10-19 12:10:22 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|