using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class PinTypeInfo
{
	public static PinTypeEnum ValueToPinType(uint value)
	{
		return value switch
		{
			0u => PinTypeEnum.Variable_PIN, 
			1u => PinTypeEnum.Fixed_PIN, 
			_ => PinTypeEnum.InvalidPinTypeValue, 
		};
	}

	public static uint PinTypeToValue(PinTypeEnum enumItem)
	{
		return enumItem switch
		{
			PinTypeEnum.Variable_PIN => 0u, 
			PinTypeEnum.Fixed_PIN => 1u, 
			_ => uint.MaxValue, 
		};
	}

	public static string PinTypeToString(PinTypeEnum enumItem)
	{
		return enumItem switch
		{
			PinTypeEnum.Variable_PIN => "Variable_PIN", 
			PinTypeEnum.Fixed_PIN => "Fixed_PIN", 
			_ => "Invalid PinType Value", 
		};
	}

	public static string PinTypeToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = Variable_PIN");
		stringBuilder.AppendLine("0x1 = Fixed_PIN");
		return stringBuilder.ToString();
	}
}
