using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class LeSetEventMaskInfo : PacketInfoBase
{
	public override string Name => "Le Set Event Mask";

	public override string DisplayGroup => "LE Controller";

	public LeSetEventMaskInfo(LeSetEventMask packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		LeSetEventMask leSetEventMask = (LeSetEventMask)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("LE_Event_Mask", LeSetEventMask.UserFieldsWrapper.LeEventMaskInfo.LeEventMaskToDescription(), 64, FormatValue(leSetEventMask.UserFields.LeEventMask, 64), LeSetEventMask.UserFieldsWrapper.LeEventMaskInfo.LeEventMaskToString(LeSetEventMask.UserFieldsWrapper.LeEventMaskInfo.ValueToLeEventMask(leSetEventMask.UserFields.LeEventMask)), "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		LeSetEventMask leSetEventMask = (LeSetEventMask)packet;
		int num = -1;
		if (index == ++num)
		{
			leSetEventMask.UserFields.LeEventMask = Convert.ToUInt64(value, 16);
		}
	}
}
