using System;
using QCRPG.Framework;

namespace QCRPG.TSL.FMHCI.Packets;

public class RdsLockStatusInfo : PacketInfoBase
{
	public override string Name => "Rds Lock Status";

	public override string DisplayGroup => "Events";

	public RdsLockStatusInfo(RdsLockStatus packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		RdsLockStatus rdsLockStatus = (RdsLockStatus)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("RDS Capability", RdsLockStatus.UserFieldsWrapper.RdsCapabilityInfo.RdsCapabilityToDescription(), 8, FormatValue(rdsLockStatus.UserFields.RdsCapability, 8), RdsLockStatus.UserFieldsWrapper.RdsCapabilityInfo.RdsCapabilityToString(RdsLockStatus.UserFieldsWrapper.RdsCapabilityInfo.ValueToRdsCapability(rdsLockStatus.UserFields.RdsCapability)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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