using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class EnableDualScoInfo : PacketInfoBase
{
	public override string Name => "Enable Dual Sco";

	public override string DisplayGroup => "Vendor Specific";

	public EnableDualScoInfo(EnableDualSco packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		EnableDualSco enableDualSco = (EnableDualSco)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Enable", EnableDualSco.UserFieldsWrapper.EnableInfo.EnableToDescription(), 8, FormatValue(enableDualSco.UserFields.Enable, 8), EnableDualSco.UserFieldsWrapper.EnableInfo.EnableToString(EnableDualSco.UserFieldsWrapper.EnableInfo.ValueToEnable(enableDualSco.UserFields.Enable)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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