IRC parsing, tokenization, and state handling in C#
1namespace IRCStates;
2
3public class ChannelUser
4{
5 public List<string> Modes { get; } = [];
6
7 private bool Equals(ChannelUser other) => other != null && Equals(Modes, other.Modes);
8
9 public override bool Equals(object obj)
10 {
11 if (ReferenceEquals(null, obj))
12 {
13 return false;
14 }
15
16 if (ReferenceEquals(this, obj))
17 {
18 return true;
19 }
20
21 return obj.GetType() == GetType() && Equals((ChannelUser) obj);
22 }
23
24 public override int GetHashCode() => Modes != null ? Modes.GetHashCode() : 0;
25}