using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class SetReservedLtAddrInfo : PacketInfoBase
{
	public override string Name => "Set Reserved Lt Addr";

	public override string DisplayGroup => "Host Control and Baseband";

	public SetReservedLtAddrInfo(SetReservedLtAddr packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		SetReservedLtAddr setReservedLtAddr = (SetReservedLtAddr)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("LT_ADDR", SetReservedLtAddr.UserFieldsWrapper.LtAddrInfo.LtAddrToDescription(), 8, FormatValue(setReservedLtAddr.UserFields.LtAddr, 8), SetReservedLtAddr.UserFieldsWrapper.LtAddrInfo.LtAddrToString(SetReservedLtAddr.UserFieldsWrapper.LtAddrInfo.ValueToLtAddr(setReservedLtAddr.UserFields.LtAddr)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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