diff options
author | Ben Harris <ben@tilde.team> | 2020-05-14 02:10:04 -0400 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2020-05-14 02:10:04 -0400 |
commit | a0fbcf83c57d15bf4bbdd2f18a8b8d539e3e4a1a (patch) | |
tree | 2399e5b4f920a10917451069d808cfc4d2eb259b /IrcStates/ChannelUser.cs | |
parent | 023e29ab75f1f413f918346edaddafdf8b1df5ee (diff) |
Implement lots of things
Diffstat (limited to 'IrcStates/ChannelUser.cs')
-rw-r--r-- | IrcStates/ChannelUser.cs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/IrcStates/ChannelUser.cs b/IrcStates/ChannelUser.cs index 220a9c4..fab881c 100644 --- a/IrcStates/ChannelUser.cs +++ b/IrcStates/ChannelUser.cs @@ -4,11 +4,29 @@ namespace IrcStates { public class ChannelUser { - public List<string> Modes { get; set; } - public ChannelUser() { Modes = new List<string>(); } + + public List<string> Modes { get; set; } + + protected bool Equals(ChannelUser other) + { + return other != null && Equals(Modes, other.Modes); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != GetType()) return false; + return Equals((ChannelUser) obj); + } + + public override int GetHashCode() + { + return Modes != null ? Modes.GetHashCode() : 0; + } } } |