using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class ReadDdbKeyEntryByIndexInfo : PacketInfoBase
{
	public override string Name => "Read Ddb Key Entry By Index";

	public override string DisplayGroup => "Vendor Specific";

	public ReadDdbKeyEntryByIndexInfo(ReadDdbKeyEntryByIndex packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		ReadDdbKeyEntryByIndex readDdbKeyEntryByIndex = (ReadDdbKeyEntryByIndex)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Index", "The index of DDB key entry", 8, FormatValue(readDdbKeyEntryByIndex.UserFields.Index, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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