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