using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class HeadlessReadLastMemoryInfo : PacketInfoBase
{
	public override string Name => "Headless Read Last Memory";

	public override string DisplayGroup => "Vendor Specific";

	public HeadlessReadLastMemoryInfo(HeadlessReadLastMemory packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		HeadlessReadLastMemory headlessReadLastMemory = (HeadlessReadLastMemory)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Sub OpCode", "HCI_VSC_READ_LAST_MEMORY", 8, FormatValue(headlessReadLastMemory.UserFields.SubOpcode, 8), "", "", "", settable: false, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		_ = (HeadlessReadLastMemory)packet;
		int num = -1;
		if (index == ++num)
		{
			throw new Exception("Tried to set non-settable field SubOpcode");
		}
	}
}
