using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class LeBatchScanEnableCustomerSpecificFeatureInfo : PacketInfoBase
{
	public override string Name => "Le Batch Scan Enable Customer Specific Feature";

	public override string DisplayGroup => "Vendor Specific";

	public LeBatchScanEnableCustomerSpecificFeatureInfo(LeBatchScanEnableCustomerSpecificFeature packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		LeBatchScanEnableCustomerSpecificFeature leBatchScanEnableCustomerSpecificFeature = (LeBatchScanEnableCustomerSpecificFeature)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Batch_Scan_opcode", "Enable customer specific feature", 8, FormatValue(leBatchScanEnableCustomerSpecificFeature.UserFields.BatchScanOpcode, 8), "", "", "", settable: false, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Enable_customer_specific_feature_set", LeBatchScanEnableCustomerSpecificFeature.UserFieldsWrapper.EnableCustomerSpecificFeatureSetInfo.EnableCustomerSpecificFeatureSetToDescription(), 8, FormatValue(leBatchScanEnableCustomerSpecificFeature.UserFields.EnableCustomerSpecificFeatureSet, 8), LeBatchScanEnableCustomerSpecificFeature.UserFieldsWrapper.EnableCustomerSpecificFeatureSetInfo.EnableCustomerSpecificFeatureSetToString(LeBatchScanEnableCustomerSpecificFeature.UserFieldsWrapper.EnableCustomerSpecificFeatureSetInfo.ValueToEnableCustomerSpecificFeatureSet(leBatchScanEnableCustomerSpecificFeature.UserFields.EnableCustomerSpecificFeatureSet)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		LeBatchScanEnableCustomerSpecificFeature leBatchScanEnableCustomerSpecificFeature = (LeBatchScanEnableCustomerSpecificFeature)packet;
		int num = -1;
		if (index == ++num)
		{
			throw new Exception("Tried to set non-settable field BatchScanOpcode");
		}
		if (index == ++num)
		{
			leBatchScanEnableCustomerSpecificFeature.UserFields.EnableCustomerSpecificFeatureSet = Convert.ToUInt32(value, 16);
		}
	}
}
