using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class AmpTestInfo : PacketInfoBase
{
	public override string Name => "Amp Test";

	public override string DisplayGroup => "Testing";

	public AmpTestInfo(AmpTest packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		AmpTest ampTest = (AmpTest)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Test_Parameters", "Controller Type. See Assigned Numbers.", 8, FormatValue(ampTest.UserFields.TestParameters, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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