using skyscraper5.Mpeg2.Descriptors;

namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory.Model
{
    internal class InMemoryCaSystem
    {
        public int CurrentNetworkId { get; }
        public int CurrentTransportStreamId { get; }

        public InMemoryCaSystem(int currentNetworkId, int currentTransportStreamId, CaDescriptor caDescriptor)
        {
            CurrentNetworkId = currentNetworkId;
            CurrentTransportStreamId = currentTransportStreamId;
            CaPid = caDescriptor.CaPid;
            CaSystemId = caDescriptor.CaSystemId;
            PrivateData = caDescriptor.PrivateData;
        }

        public byte[] PrivateData { get; private set; }

        public ushort CaSystemId { get; private set; }

        public int CaPid { get; private set; }

        public override string ToString()
        {
            return $"{CurrentNetworkId},{CurrentTransportStreamId},{CaPid},{CaSystemNames.GetHumanReadableName(CaSystemId)}";
        }
    }
}
