using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class IsoPackingInfo
{
	public static IsoPackingEnum ValueToIsoPacking(uint value)
	{
		return value switch
		{
			0u => IsoPackingEnum.Sequential, 
			1u => IsoPackingEnum.Interleaved, 
			_ => IsoPackingEnum.InvalidIsoPackingValue, 
		};
	}

	public static uint IsoPackingToValue(IsoPackingEnum enumItem)
	{
		return enumItem switch
		{
			IsoPackingEnum.Sequential => 0u, 
			IsoPackingEnum.Interleaved => 1u, 
			_ => uint.MaxValue, 
		};
	}

	public static string IsoPackingToString(IsoPackingEnum enumItem)
	{
		return enumItem switch
		{
			IsoPackingEnum.Sequential => "Sequential", 
			IsoPackingEnum.Interleaved => "Interleaved", 
			_ => "Invalid IsoPacking Value", 
		};
	}

	public static string IsoPackingToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = Sequential");
		stringBuilder.AppendLine("0x1 = Interleaved");
		return stringBuilder.ToString();
	}
}
