using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class WriteLoopbackModeInfo : PacketInfoBase
{
	public override string Name => "Write Loopback Mode";

	public override string DisplayGroup => "Testing";

	public WriteLoopbackModeInfo(WriteLoopbackMode packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		WriteLoopbackMode writeLoopbackMode = (WriteLoopbackMode)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Loopback Mode", WriteLoopbackMode.UserFieldsWrapper.LoopbackModeInfo.LoopbackModeToDescription(), 8, FormatValue(writeLoopbackMode.UserFields.LoopbackMode, 8), WriteLoopbackMode.UserFieldsWrapper.LoopbackModeInfo.LoopbackModeToString(WriteLoopbackMode.UserFieldsWrapper.LoopbackModeInfo.ValueToLoopbackMode(writeLoopbackMode.UserFields.LoopbackMode)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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