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

namespace skyscraper5.src.Skyscraper.FrequencyListGenerator
{
	public class HumanReadableService
	{
		public ushort ServiceId { get; private set; }
		public string ProviderName { get; private set; }
		public string ServiceName { get; private set; }
		public ushort? CaId { get; private set; }
		public ServiceDescriptor.ServiceTypeCoding ServiceType { get; private set; }

		public HumanReadableService(ushort serviceId, string providerName, string serviceName, ushort? caId,
			ServiceDescriptor.ServiceTypeCoding serviceType)
		{
			ServiceId = serviceId;
			ProviderName = providerName;
			ServiceName = serviceName;
			CaId = caId;
			ServiceType = serviceType;

			if (ProviderName == null)
				ProviderName = "???";
			if (ServiceName == null)
				ServiceName = "???";
		}

		public override string ToString()
		{
			return $"{nameof(ServiceId)}: {ServiceId}, {nameof(ProviderName)}: {ProviderName}, {nameof(ServiceName)}: {ServiceName}, {nameof(CaId)}: {CaId}, {nameof(ServiceType)}: {ServiceType}";
		}
	}
}
