using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class WriteFlowControlModeInfo : PacketInfoBase
{
	public override string Name => "Write Flow Control Mode";

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

	public WriteFlowControlModeInfo(WriteFlowControlMode packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		WriteFlowControlMode writeFlowControlMode = (WriteFlowControlMode)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Flow_Control_Mode", WriteFlowControlMode.UserFieldsWrapper.FlowControlModeInfo.FlowControlModeToDescription(), 8, FormatValue(writeFlowControlMode.UserFields.FlowControlMode, 8), WriteFlowControlMode.UserFieldsWrapper.FlowControlModeInfo.FlowControlModeToString(WriteFlowControlMode.UserFieldsWrapper.FlowControlModeInfo.ValueToFlowControlMode(writeFlowControlMode.UserFields.FlowControlMode)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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