using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class DeleteDdbKeyEntryInfo : PacketInfoBase
{
	public override string Name => "Delete Ddb Key Entry";

	public override string DisplayGroup => "Vendor Specific";

	public DeleteDdbKeyEntryInfo(DeleteDdbKeyEntry packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		DeleteDdbKeyEntry deleteDdbKeyEntry = (DeleteDdbKeyEntry)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Bd_Address", "Bluetooth Address of Device", 48, FormatValue(deleteDdbKeyEntry.UserFields.BdAddress, 48), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		DeleteDdbKeyEntry deleteDdbKeyEntry = (DeleteDdbKeyEntry)packet;
		int num = -1;
		if (index == ++num)
		{
			deleteDdbKeyEntry.UserFields.BdAddress = Convert.ToUInt64(value, 16);
		}
	}
}
