2017-08-22 03:48:45 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
2017-10-13 04:14:54 +00:00
|
|
|
|
namespace NadekoBot.Core.Services.Database.Models
|
2017-08-22 03:48:45 +00:00
|
|
|
|
{
|
|
|
|
|
public class XpSettings : DbEntity
|
|
|
|
|
{
|
|
|
|
|
public int GuildConfigId { get; set; }
|
|
|
|
|
public GuildConfig GuildConfig { get; set; }
|
|
|
|
|
|
|
|
|
|
public HashSet<XpRoleReward> RoleRewards { get; set; } = new HashSet<XpRoleReward>();
|
2017-11-15 01:42:48 +00:00
|
|
|
|
public HashSet<XpCurrencyReward> CurrencyRewards { get; set; } = new HashSet<XpCurrencyReward>();
|
2017-08-22 03:48:45 +00:00
|
|
|
|
public bool XpRoleRewardExclusive { get; set; }
|
|
|
|
|
public string NotifyMessage { get; set; } = "Congratulations {0}! You have reached level {1}!";
|
|
|
|
|
public HashSet<ExcludedItem> ExclusionList { get; set; } = new HashSet<ExcludedItem>();
|
|
|
|
|
public bool ServerExcluded { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum ExcludedItemType { Channel, Role }
|
|
|
|
|
|
|
|
|
|
public class XpRoleReward : DbEntity
|
|
|
|
|
{
|
2017-09-23 01:32:12 +00:00
|
|
|
|
public int XpSettingsId { get; set; }
|
|
|
|
|
public XpSettings XpSettings { get; set; }
|
|
|
|
|
|
2017-08-22 03:48:45 +00:00
|
|
|
|
public int Level { get; set; }
|
|
|
|
|
public ulong RoleId { get; set; }
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
2017-09-23 01:32:12 +00:00
|
|
|
|
return Level.GetHashCode() ^ XpSettingsId.GetHashCode();
|
2017-08-22 03:48:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
2017-09-23 01:32:12 +00:00
|
|
|
|
return obj is XpRoleReward xrr && xrr.Level == Level && xrr.XpSettingsId == XpSettingsId;
|
2017-08-22 03:48:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-15 01:42:48 +00:00
|
|
|
|
public class XpCurrencyReward : DbEntity
|
|
|
|
|
{
|
|
|
|
|
public int XpSettingsId { get; set; }
|
|
|
|
|
public XpSettings XpSettings { get; set; }
|
|
|
|
|
|
|
|
|
|
public int Level { get; set; }
|
|
|
|
|
public int Amount { get; set; }
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return Level.GetHashCode() ^ XpSettingsId.GetHashCode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
return obj is XpCurrencyReward xrr && xrr.Level == Level && xrr.XpSettingsId == XpSettingsId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-22 03:48:45 +00:00
|
|
|
|
public class ExcludedItem : DbEntity
|
|
|
|
|
{
|
|
|
|
|
public ulong ItemId { get; set; }
|
|
|
|
|
public ExcludedItemType ItemType { get; set; }
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return ItemId.GetHashCode() ^ ItemType.GetHashCode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
return obj is ExcludedItem ei && ei.ItemId == ItemId && ei.ItemType == ItemType;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|