using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using skyscraper5.Skyscraper.IO;
using skyscraper5.Skyscraper.Plugins;

namespace skyscraper5.T2MI.Packets
{
	[SkyscraperPlugin]
	[T2MiPacketType(0x12)]
    internal class _0x12_P2BiasBalancingCells : T2MiPacket
    {
        public _0x12_P2BiasBalancingCells(T2MIHeader header, byte[] buffer) : base(header, buffer)
        {
            if (buffer.Length != 5)
            {
                Valid = false;
                return;
            }
            MemoryStream ms = new MemoryStream(buffer, false);
            FrameIndex = ms.ReadUInt8();
            NumActiveBiasCellsPerP2 = (ms.ReadUInt32BE() & 0x00007fff);
            Valid = true;
        }

        public uint NumActiveBiasCellsPerP2 { get; private set; }

        public byte FrameIndex { get; private set; }
    }
}
