using System.Collections.Generic; namespace NadekoBot.Services.Database.Models { public class StreamRoleSettings : DbEntity { public int GuildConfigId { get; set; } public GuildConfig GuildConfig { get; set; } /// /// Whether the feature is enabled in the guild. /// public bool Enabled { get; set; } /// /// Id of the role to give to the users in the role 'FromRole' when they start streaming /// public ulong AddRoleId { get; set; } /// /// Id of the role whose users are eligible to get the 'AddRole' /// public ulong FromRoleId { get; set; } /// /// If set, feature will only apply to users who have this keyword in their streaming status. /// public string Keyword { get; set; } /// /// A collection of whitelisted users' IDs. Whitelisted users don't require 'keyword' in /// order to get the stream role. /// public HashSet Whitelist { get; set; } = new HashSet(); /// /// A collection of blacklisted users' IDs. Blacklisted useres will never get the stream role. /// public HashSet Blacklist { get; set; } = new HashSet(); } public class StreamRoleBlacklistedUser : DbEntity { public ulong UserId { get; set; } public string Username { get; set; } public override bool Equals(object obj) { var x = obj as StreamRoleBlacklistedUser; if (x == null) return false; return x.UserId == UserId; } public override int GetHashCode() { return UserId.GetHashCode(); } } public class StreamRoleWhitelistedUser : DbEntity { public ulong UserId { get; set; } public string Username { get; set; } public override bool Equals(object obj) { var x = obj as StreamRoleWhitelistedUser; if (x == null) return false; return x.UserId == UserId; } public override int GetHashCode() { return UserId.GetHashCode(); } } }