using System;
using QCRPG.Framework;

namespace QCRPG.TSL.NFC.Packets;

public class RfFieldInfoNtfInfo : PacketInfoBase
{
	public override string Name => "Rf Field Info Ntf";

	public override string DisplayGroup => "RF Management";

	public RfFieldInfoNtfInfo(RfFieldInfoNtf packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		RfFieldInfoNtf rfFieldInfoNtf = (RfFieldInfoNtf)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("RF Field Status", RfFieldInfoNtf.UserFieldsWrapper.RfFieldStatusInfo.RfFieldStatusToDescription(), 8, FormatValue(rfFieldInfoNtf.UserFields.RfFieldStatus, 8), RfFieldInfoNtf.UserFieldsWrapper.RfFieldStatusInfo.RfFieldStatusToString(RfFieldInfoNtf.UserFieldsWrapper.RfFieldStatusInfo.ValueToRfFieldStatus(rfFieldInfoNtf.UserFields.RfFieldStatus)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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