using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper8.Ietf.FLUTE
{
	internal class FluteBlockComparer : IComparer<FluteListener.FluteBlock>
	{
		public int Compare(FluteListener.FluteBlock? x, FluteListener.FluteBlock? y)
		{
			uint x1 = MakeUint(x);
			uint y1 = MakeUint(y);
			int result = x1.CompareTo(y1);
			return result;
		}

		private uint MakeUint(FluteListener.FluteBlock? x)
		{
			uint value = x.SourceBlockNumer;
			value <<= 16;
			value += x.EncodingSymbolId;
			return value;
		}
	}
}
