using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory.Model
{
    internal class DocsisUpstreamChannelCoordinate
    {
        public PhysicalAddress SourceAddress;
        public uint Frequency;

        public DocsisUpstreamChannelCoordinate(PhysicalAddress sourceAddress, uint frequency)
        {
            SourceAddress = sourceAddress;
            Frequency = frequency;
        }

        protected bool Equals(DocsisUpstreamChannelCoordinate other)
        {
            return Equals(SourceAddress, other.SourceAddress) && Frequency == other.Frequency;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((DocsisUpstreamChannelCoordinate)obj);
        }

        public override int GetHashCode()
        {
            return HashCode.Combine(SourceAddress, Frequency);
        }

        public override string ToString()
        {
            return $"{nameof(SourceAddress)}: {SourceAddress}, {nameof(Frequency)}: {Frequency}";
        }
    }
}
