using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class WritePageScanTypeInfo : PacketInfoBase
{
	public override string Name => "Write Page Scan Type";

	public override string DisplayGroup => "Host Control and Baseband";

	public WritePageScanTypeInfo(WritePageScanType packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		WritePageScanType writePageScanType = (WritePageScanType)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Page Scan Type", WritePageScanType.UserFieldsWrapper.PageScanTypeInfo.PageScanTypeToDescription(), 8, FormatValue(writePageScanType.UserFields.PageScanType, 8), WritePageScanType.UserFieldsWrapper.PageScanTypeInfo.PageScanTypeToString(WritePageScanType.UserFieldsWrapper.PageScanTypeInfo.ValueToPageScanType(writePageScanType.UserFields.PageScanType)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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