using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class EnableAmpReceiverReportsInfo : PacketInfoBase
{
	public override string Name => "Enable Amp Receiver Reports";

	public override string DisplayGroup => "Testing";

	public EnableAmpReceiverReportsInfo(EnableAmpReceiverReports packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		EnableAmpReceiverReports enableAmpReceiverReports = (EnableAmpReceiverReports)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Enable", EnableAmpReceiverReports.UserFieldsWrapper.EnableInfo.EnableToDescription(), 8, FormatValue(enableAmpReceiverReports.UserFields.Enable, 8), EnableAmpReceiverReports.UserFieldsWrapper.EnableInfo.EnableToString(EnableAmpReceiverReports.UserFieldsWrapper.EnableInfo.ValueToEnable(enableAmpReceiverReports.UserFields.Enable)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Interval", EnableAmpReceiverReports.UserFieldsWrapper.IntervalInfo.IntervalToDescription(), 8, FormatValue(enableAmpReceiverReports.UserFields.Interval, 8), EnableAmpReceiverReports.UserFieldsWrapper.IntervalInfo.IntervalToString(EnableAmpReceiverReports.UserFieldsWrapper.IntervalInfo.ValueToInterval(enableAmpReceiverReports.UserFields.Interval)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		EnableAmpReceiverReports enableAmpReceiverReports = (EnableAmpReceiverReports)packet;
		int num = -1;
		if (index == ++num)
		{
			enableAmpReceiverReports.UserFields.Enable = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enableAmpReceiverReports.UserFields.Interval = Convert.ToUInt32(value, 16);
		}
	}
}
