using System;
using QCRPG.Framework;

namespace QCRPG.TSL.FMHCI.Packets;

public class EnableNotchControlInfo : PacketInfoBase
{
	public override string Name => "Enable Notch Control";

	public override string DisplayGroup => "Receiver Control";

	public EnableNotchControlInfo(EnableNotchControl packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		EnableNotchControl enableNotchControl = (EnableNotchControl)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Notch Enable", EnableNotchControl.UserFieldsWrapper.NotchEnableInfo.NotchEnableToDescription(), 8, FormatValue(enableNotchControl.UserFields.NotchEnable, 8), EnableNotchControl.UserFieldsWrapper.NotchEnableInfo.NotchEnableToString(EnableNotchControl.UserFieldsWrapper.NotchEnableInfo.ValueToNotchEnable(enableNotchControl.UserFields.NotchEnable)), "", "2", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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