using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class IsoPayloadtypeInfo
{
	public static IsoPayloadtypeEnum ValueToIsoPayloadtype(uint value)
	{
		return value switch
		{
			0u => IsoPayloadtypeEnum.Zero_Length, 
			1u => IsoPayloadtypeEnum.Variable_Length, 
			2u => IsoPayloadtypeEnum.Max_Length, 
			_ => IsoPayloadtypeEnum.InvalidIsoPayloadtypeValue, 
		};
	}

	public static uint IsoPayloadtypeToValue(IsoPayloadtypeEnum enumItem)
	{
		return enumItem switch
		{
			IsoPayloadtypeEnum.Zero_Length => 0u, 
			IsoPayloadtypeEnum.Variable_Length => 1u, 
			IsoPayloadtypeEnum.Max_Length => 2u, 
			_ => uint.MaxValue, 
		};
	}

	public static string IsoPayloadtypeToString(IsoPayloadtypeEnum enumItem)
	{
		return enumItem switch
		{
			IsoPayloadtypeEnum.Zero_Length => "Zero length payload", 
			IsoPayloadtypeEnum.Variable_Length => "Variable length payload", 
			IsoPayloadtypeEnum.Max_Length => "Maximum length payload", 
			_ => "Invalid IsoPayloadtype Value", 
		};
	}

	public static string IsoPayloadtypeToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = Zero length payload");
		stringBuilder.AppendLine("0x1 = Variable length payload");
		stringBuilder.AppendLine("0x2 = Maximum length payload");
		return stringBuilder.ToString();
	}
}
