using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class GigawakeConfigurationInfo : PacketInfoBase
{
	public override string Name => "Gigawake Configuration";

	public override string DisplayGroup => "Vendor Specific";

	public GigawakeConfigurationInfo(GigawakeConfiguration packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		GigawakeConfiguration gigawakeConfiguration = (GigawakeConfiguration)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Feature_Enable", GigawakeConfiguration.UserFieldsWrapper.FeatureEnableInfo.FeatureEnableToDescription(), 8, FormatValue(gigawakeConfiguration.UserFields.FeatureEnable, 8), GigawakeConfiguration.UserFieldsWrapper.FeatureEnableInfo.FeatureEnableToString(GigawakeConfiguration.UserFieldsWrapper.FeatureEnableInfo.ValueToFeatureEnable(gigawakeConfiguration.UserFields.FeatureEnable)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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