using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class ListModeRxPacketTypeInfo
{
	public static ListModeRxPacketTypeEnum ValueToListModeRxPacketType(uint value)
	{
		return value switch
		{
			0u => ListModeRxPacketTypeEnum.DM1, 
			1u => ListModeRxPacketTypeEnum.DH1, 
			2u => ListModeRxPacketTypeEnum.DH5, 
			3u => ListModeRxPacketTypeEnum.TWO_DH5, 
			4u => ListModeRxPacketTypeEnum.THREE_DH5, 
			5u => ListModeRxPacketTypeEnum.LE, 
			_ => ListModeRxPacketTypeEnum.InvalidListModeRxPacketTypeValue, 
		};
	}

	public static uint ListModeRxPacketTypeToValue(ListModeRxPacketTypeEnum enumItem)
	{
		return enumItem switch
		{
			ListModeRxPacketTypeEnum.DM1 => 0u, 
			ListModeRxPacketTypeEnum.DH1 => 1u, 
			ListModeRxPacketTypeEnum.DH5 => 2u, 
			ListModeRxPacketTypeEnum.TWO_DH5 => 3u, 
			ListModeRxPacketTypeEnum.THREE_DH5 => 4u, 
			ListModeRxPacketTypeEnum.LE => 5u, 
			_ => uint.MaxValue, 
		};
	}

	public static string ListModeRxPacketTypeToString(ListModeRxPacketTypeEnum enumItem)
	{
		return enumItem switch
		{
			ListModeRxPacketTypeEnum.DM1 => "DM1", 
			ListModeRxPacketTypeEnum.DH1 => "DH1", 
			ListModeRxPacketTypeEnum.DH5 => "DH5", 
			ListModeRxPacketTypeEnum.TWO_DH5 => "TWO_DH5", 
			ListModeRxPacketTypeEnum.THREE_DH5 => "THREE_DH5", 
			ListModeRxPacketTypeEnum.LE => "LE", 
			_ => "Invalid ListModeRxPacketType Value", 
		};
	}

	public static string ListModeRxPacketTypeToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = DM1");
		stringBuilder.AppendLine("0x1 = DH1");
		stringBuilder.AppendLine("0x2 = DH5");
		stringBuilder.AppendLine("0x3 = TWO_DH5");
		stringBuilder.AppendLine("0x4 = THREE_DH5");
		stringBuilder.AppendLine("0x5 = LE");
		return stringBuilder.ToString();
	}
}
