using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

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

	public override string DisplayGroup => "Host Control and Baseband";

	public SetEventMaskInfo(SetEventMask packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		SetEventMask setEventMask = (SetEventMask)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Event Mask", SetEventMask.UserFieldsWrapper.EventMaskInfo.EventMaskToDescription(), 64, FormatValue(setEventMask.UserFields.EventMask, 64), SetEventMask.UserFieldsWrapper.EventMaskInfo.EventMaskToString(SetEventMask.UserFieldsWrapper.EventMaskInfo.ValueToEventMask(setEventMask.UserFields.EventMask)), "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

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