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)
8 {
9 return other != null && Equals(Modes, other.Modes);
10 }
11
12 public override bool Equals(object obj)
13 {
14 if (ReferenceEquals(null, obj)) return false;
15 if (ReferenceEquals(this, obj)) return true;
16 return obj.GetType() == GetType() && Equals((ChannelUser) obj);
17 }
18
19 public override int GetHashCode()
20 {
21 return Modes != null ? Modes.GetHashCode() : 0;
22 }
23}