about summary refs log tree commit diff
path: root/IRCStates/ChannelUser.cs
blob: bc5e99b94114a88525bb27750db6968104d00c67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System.Collections.Generic;

namespace IRCStates
{
    public class ChannelUser
    {
        public ChannelUser()
        {
            Modes = new List<string>();
        }

        public List<string> Modes { get; }

        private 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;
            return obj.GetType() == GetType() && Equals((ChannelUser) obj);
        }

        public override int GetHashCode()
        {
            return Modes != null ? Modes.GetHashCode() : 0;
        }
    }
}