using System;
using QCRPG.Framework;

namespace QCRPG.TSL.NFC.Packets;

public class NfceeDiscoverCmdInfo : PacketInfoBase
{
	public override string Name => "Nfcee Discover Cmd";

	public override string DisplayGroup => "NFCEE Management";

	public NfceeDiscoverCmdInfo(NfceeDiscoverCmd packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		NfceeDiscoverCmd nfceeDiscoverCmd = (NfceeDiscoverCmd)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Discovery Action", NfceeDiscoverCmd.UserFieldsWrapper.DiscoveryActionInfo.DiscoveryActionToDescription(), 8, FormatValue(nfceeDiscoverCmd.UserFields.DiscoveryAction, 8), NfceeDiscoverCmd.UserFieldsWrapper.DiscoveryActionInfo.DiscoveryActionToString(NfceeDiscoverCmd.UserFieldsWrapper.DiscoveryActionInfo.ValueToDiscoveryAction(nfceeDiscoverCmd.UserFields.DiscoveryAction)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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