using Newtonsoft.Json;
using skyscraper5.Mpeg2;
using skyscraper5.Skyscraper.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper5.src.InteractionChannel.Model.Descriptors
{
	[SkyscraperPlugin]
	[TsDescriptor(0xa0,"TIM")]
	public class _0xa0_NetworkLayerInfoDescriptor : TsDescriptor
	{
		[JsonConstructor]
		public _0xa0_NetworkLayerInfoDescriptor(byte[] MessageBuffer)
		{
			this.MessageBuffer = (byte[])MessageBuffer.Clone();
			Valid = true;
		}

		public byte[] MessageBuffer { get; }

		public override bool DescriptorEquals(TsDescriptor thatDescriptor)
		{
			_0xa0_NetworkLayerInfoDescriptor? that = thatDescriptor as _0xa0_NetworkLayerInfoDescriptor;
			if (that == null)
				return false;

			if (this.MessageBuffer.Length != that.MessageBuffer.Length) 
				return false;

			for (int i = 0; i < this.MessageBuffer.Length; i++)
			{
				if (this.MessageBuffer[i] != that.MessageBuffer[i])
					return false;
			}
			return true;
		}

		public override string ToString()
		{
			return "Network Layer Info";
		}
	}
}
