using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class IsoFramingInfo
{
	public static IsoFramingEnum ValueToIsoFraming(uint value)
	{
		return value switch
		{
			0u => IsoFramingEnum.Unframed, 
			1u => IsoFramingEnum.Framed, 
			_ => IsoFramingEnum.InvalidIsoFramingValue, 
		};
	}

	public static uint IsoFramingToValue(IsoFramingEnum enumItem)
	{
		return enumItem switch
		{
			IsoFramingEnum.Unframed => 0u, 
			IsoFramingEnum.Framed => 1u, 
			_ => uint.MaxValue, 
		};
	}

	public static string IsoFramingToString(IsoFramingEnum enumItem)
	{
		return enumItem switch
		{
			IsoFramingEnum.Unframed => "Unframed", 
			IsoFramingEnum.Framed => "Framed", 
			_ => "Invalid IsoFraming Value", 
		};
	}

	public static string IsoFramingToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = Unframed");
		stringBuilder.AppendLine("0x1 = Framed");
		return stringBuilder.ToString();
	}
}
