using System;
using QCRPG.Framework;

namespace QCRPG.TSL.NFC.Packets;

public class CoreResetCmdInfo : PacketInfoBase
{
	public override string Name => "Core Reset Cmd";

	public override string DisplayGroup => "NCI Core";

	public CoreResetCmdInfo(CoreResetCmd packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		CoreResetCmd coreResetCmd = (CoreResetCmd)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Reset Type", CoreResetCmd.UserFieldsWrapper.ResetTypeInfo.ResetTypeToDescription(), 8, FormatValue(coreResetCmd.UserFields.ResetType, 8), CoreResetCmd.UserFieldsWrapper.ResetTypeInfo.ResetTypeToString(CoreResetCmd.UserFieldsWrapper.ResetTypeInfo.ValueToResetType(coreResetCmd.UserFields.ResetType)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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