using System;
using QCRPG.Framework;

namespace QCRPG.TSL.FMHCI.Packets;

public class ReadGroupCountersInfo : PacketInfoBase
{
	public override string Name => "Read Group Counters";

	public override string DisplayGroup => "Status Parameters";

	public ReadGroupCountersInfo(ReadGroupCounters packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		ReadGroupCounters readGroupCounters = (ReadGroupCounters)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Reset Counters", ReadGroupCounters.UserFieldsWrapper.ResetCountersInfo.ResetCountersToDescription(), 8, FormatValue(readGroupCounters.UserFields.ResetCounters, 8), ReadGroupCounters.UserFieldsWrapper.ResetCountersInfo.ResetCountersToString(ReadGroupCounters.UserFieldsWrapper.ResetCountersInfo.ValueToResetCounters(readGroupCounters.UserFields.ResetCounters)), "", "1", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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