using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using skyscraper5.Dvb.Psi.Model;

namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory.Model
{
    internal class RstCoordinates
    {
        public uint OriginalNetworkId { get; }
        public uint TransportStreamId { get; }
        public uint ServiceId { get; }
        public uint EventId { get; }
        public RunningStatus RunningStatus { get; }
        public DateTime CurrentTime { get; }

        public RstCoordinates(uint originalNetworkId, uint transportStreamId, uint serviceId, uint eventId, RunningStatus runningStatus, DateTime currentTime)
        {
            OriginalNetworkId = originalNetworkId;
            TransportStreamId = transportStreamId;
            ServiceId = serviceId;
            EventId = eventId;
            RunningStatus = runningStatus;
            CurrentTime = currentTime;
        }

        protected bool Equals(RstCoordinates other)
        {
            return OriginalNetworkId == other.OriginalNetworkId && TransportStreamId == other.TransportStreamId && ServiceId == other.ServiceId && EventId == other.EventId && RunningStatus == other.RunningStatus;
        }

        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((RstCoordinates)obj);
        }

        public override int GetHashCode()
        {
            return HashCode.Combine(OriginalNetworkId, TransportStreamId, ServiceId, EventId, (int)RunningStatus);
        }
    }
}
