using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class IsoEncryptionInfo
{
	public static IsoEncryptionEnum ValueToIsoEncryption(uint value)
	{
		return value switch
		{
			0u => IsoEncryptionEnum.Unencrypted, 
			1u => IsoEncryptionEnum.Encrypted, 
			_ => IsoEncryptionEnum.InvalidIsoEncryptionValue, 
		};
	}

	public static uint IsoEncryptionToValue(IsoEncryptionEnum enumItem)
	{
		return enumItem switch
		{
			IsoEncryptionEnum.Unencrypted => 0u, 
			IsoEncryptionEnum.Encrypted => 1u, 
			_ => uint.MaxValue, 
		};
	}

	public static string IsoEncryptionToString(IsoEncryptionEnum enumItem)
	{
		return enumItem switch
		{
			IsoEncryptionEnum.Unencrypted => "Unencrypted", 
			IsoEncryptionEnum.Encrypted => "Encrypted", 
			_ => "Invalid IsoEncryption Value", 
		};
	}

	public static string IsoEncryptionToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = Unencrypted");
		stringBuilder.AppendLine("0x1 = Encrypted");
		return stringBuilder.ToString();
	}
}
