using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class LeSetAddressResolutionEnableInfo : PacketInfoBase
{
	public override string Name => "Le Set Address Resolution Enable";

	public override string DisplayGroup => "LE Controller";

	public LeSetAddressResolutionEnableInfo(LeSetAddressResolutionEnable packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		LeSetAddressResolutionEnable leSetAddressResolutionEnable = (LeSetAddressResolutionEnable)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Address_Resolution_Enable", LeSetAddressResolutionEnable.UserFieldsWrapper.AddressResolutionEnableInfo.AddressResolutionEnableToDescription(), 8, FormatValue(leSetAddressResolutionEnable.UserFields.AddressResolutionEnable, 8), LeSetAddressResolutionEnable.UserFieldsWrapper.AddressResolutionEnableInfo.AddressResolutionEnableToString(LeSetAddressResolutionEnable.UserFieldsWrapper.AddressResolutionEnableInfo.ValueToAddressResolutionEnable(leSetAddressResolutionEnable.UserFields.AddressResolutionEnable)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		LeSetAddressResolutionEnable leSetAddressResolutionEnable = (LeSetAddressResolutionEnable)packet;
		int num = -1;
		if (index == ++num)
		{
			leSetAddressResolutionEnable.UserFields.AddressResolutionEnable = Convert.ToUInt32(value, 16);
		}
	}
}
