using System;
using QCRPG.Framework;

namespace QCRPG.TSL.FMHCI.Packets;

public class SetAntennaInfo : PacketInfoBase
{
	public override string Name => "Set Antenna";

	public override string DisplayGroup => "Receiver Control";

	public SetAntennaInfo(SetAntenna packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		SetAntenna setAntenna = (SetAntenna)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Antenna", SetAntenna.UserFieldsWrapper.AntennaInfo.AntennaToDescription(), 8, FormatValue(setAntenna.UserFields.Antenna, 8), SetAntenna.UserFieldsWrapper.AntennaInfo.AntennaToString(SetAntenna.UserFieldsWrapper.AntennaInfo.ValueToAntenna(setAntenna.UserFields.Antenna)), "", "1", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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