using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class LeCodedPhyPreferenceInfo
{
	public static LeCodedPhyPreferenceEnum ValueToLeCodedPhyPreference(uint value)
	{
		return value switch
		{
			0u => LeCodedPhyPreferenceEnum.The_Host_prefers_not_to_use_the_LE_Coded_PHY, 
			1u => LeCodedPhyPreferenceEnum.The_Host_prefers_to_use_the_LE_Coded_PHY_possibly_among_others, 
			_ => LeCodedPhyPreferenceEnum.InvalidLeCodedPhyPreferenceValue, 
		};
	}

	public static uint LeCodedPhyPreferenceToValue(LeCodedPhyPreferenceEnum enumItem)
	{
		return enumItem switch
		{
			LeCodedPhyPreferenceEnum.The_Host_prefers_not_to_use_the_LE_Coded_PHY => 0u, 
			LeCodedPhyPreferenceEnum.The_Host_prefers_to_use_the_LE_Coded_PHY_possibly_among_others => 1u, 
			_ => uint.MaxValue, 
		};
	}

	public static string LeCodedPhyPreferenceToString(LeCodedPhyPreferenceEnum enumItem)
	{
		return enumItem switch
		{
			LeCodedPhyPreferenceEnum.The_Host_prefers_not_to_use_the_LE_Coded_PHY => "The Host prefers not to use the LE Coded PHY", 
			LeCodedPhyPreferenceEnum.The_Host_prefers_to_use_the_LE_Coded_PHY_possibly_among_others => "The Host prefers to use the LE Coded PHY (possibly among others)", 
			_ => "Invalid LeCodedPhyPreference Value", 
		};
	}

	public static string LeCodedPhyPreferenceToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = The Host prefers not to use the LE Coded PHY");
		stringBuilder.AppendLine("0x1 = The Host prefers to use the LE Coded PHY (possibly among others)");
		return stringBuilder.ToString();
	}
}
