using System.Text;

namespace QCRPG.TSL.BT.Packets;

public static class AodSupplementalTypeInfo
{
	public static AodSupplementalTypeEnum ValueToAodSupplementalType(uint value)
	{
		switch (value)
		{
		case 0u:
			return AodSupplementalTypeEnum.AoA_Supplemental;
		case 1u:
			return AodSupplementalTypeEnum.AoD_Supplemental_with_1us_slots;
		case 2u:
			return AodSupplementalTypeEnum.AoD_Supplemental_with_2us_slots;
		default:
			if (value >= 3 && value <= 255)
			{
				return AodSupplementalTypeEnum.Reserved_for_future_use;
			}
			return AodSupplementalTypeEnum.InvalidAodSupplementalTypeValue;
		}
	}

	public static uint AodSupplementalTypeToValue(AodSupplementalTypeEnum enumItem)
	{
		return enumItem switch
		{
			AodSupplementalTypeEnum.AoA_Supplemental => 0u, 
			AodSupplementalTypeEnum.AoD_Supplemental_with_1us_slots => 1u, 
			AodSupplementalTypeEnum.AoD_Supplemental_with_2us_slots => 2u, 
			AodSupplementalTypeEnum.Reserved_for_future_use => 3u, 
			_ => uint.MaxValue, 
		};
	}

	public static string AodSupplementalTypeToString(AodSupplementalTypeEnum enumItem)
	{
		return enumItem switch
		{
			AodSupplementalTypeEnum.AoA_Supplemental => "AoA Supplemental", 
			AodSupplementalTypeEnum.AoD_Supplemental_with_1us_slots => "AoD_Supplemental_with_1us_slots", 
			AodSupplementalTypeEnum.AoD_Supplemental_with_2us_slots => "AoD_Supplemental_with_2us_slots", 
			AodSupplementalTypeEnum.Reserved_for_future_use => "Reserved for future use", 
			_ => "Invalid AodSupplementalType Value", 
		};
	}

	public static string AodSupplementalTypeToDescription()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.AppendLine("0x0 = AoA Supplemental");
		stringBuilder.AppendLine("0x1 = AoD_Supplemental_with_1us_slots");
		stringBuilder.AppendLine("0x2 = AoD_Supplemental_with_2us_slots");
		stringBuilder.AppendLine("0x3-0xFF = Reserved for future use");
		return stringBuilder.ToString();
	}
}
