using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class FlushOccurredInfo : PacketInfoBase
{
	public override string Name => "Flush Occurred";

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

	public FlushOccurredInfo(FlushOccurred packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		FlushOccurred flushOccurred = (FlushOccurred)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Handle", "Handle that was flushed. The Handle is a Connection_Handle for a Primary Controller or a Logical_Link_Handle for an AMP Controller.  Range: 0x0000-0x0EFF. Reserved for future use (0x0F00 - 0x0FFF)", 16, FormatValue(flushOccurred.UserFields.Handle, 16), "", "0000", "0EFF", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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