using System.Text;

namespace QCRPG.TSL.NFC.Packets;

public static class SuppressionBitInfo
{
	public static SuppressionBitEnum ValueToSuppressionBit(uint value)
	{
		return value switch
		{
			0u => SuppressionBitEnum.Required, 
			1u => SuppressionBitEnum.Not_Required, 
			_ => SuppressionBitEnum.InvalidSuppressionBitValue, 
		};
	}

	public static uint SuppressionBitToValue(SuppressionBitEnum enumItem)
	{
		return enumItem switch
		{
			SuppressionBitEnum.Required => 0u, 
			SuppressionBitEnum.Not_Required => 1u, 
			_ => uint.MaxValue, 
		};
	}

	public static string SuppressionBitToString(SuppressionBitEnum enumItem)
	{
		return enumItem switch
		{
			SuppressionBitEnum.Required => "Required", 
			SuppressionBitEnum.Not_Required => "Not Required", 
			_ => "Invalid SuppressionBit Value", 
		};
	}

	public static string SuppressionBitToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = Required");
		stringBuilder.AppendLine("0x1 = Not Required");
		return stringBuilder.ToString();
	}
}
