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

namespace skyscraper8.Ses
{
	public class SgtList
	{
		public SgtList(ushort serviceListId, uint v)
		{
			ServiceListId = serviceListId;
			PrivateDataSpecifier = v;
			CountryAvailabilities = new Dictionary<string, bool>();
		}

		public ushort ServiceListId { get; }
		public uint PrivateDataSpecifier { get; internal set; }

		public Dictionary<string,string> Names { get; internal set; }
		public Dictionary<string,bool> CountryAvailabilities { get; internal set; }

		public string GetName()
		{
			if (Names == null)
				return "???";

			if (Names.Count == 0)
				return "???";

			foreach (KeyValuePair<string,string> name in Names)
			{
				if (!string.IsNullOrEmpty(name.Value))
				{
					return name.Value;
				}
			}
			return "???";
			{

			}
		}
	}
}
