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

namespace skyscraper5.T2MI.Packets.AdressingFunctions
{
    internal class _0x12_TrPapr : AddressingFunction
    {
        public _0x12_TrPapr(byte[] buffer)
            : base(0x12, false, true)
        {
            if (buffer.Length != 5)
            {
                Valid = false;
                return;
            }

            MemoryStream ms = new MemoryStream(buffer, false);
            TrClippingThreshold = ms.ReadUInt16BE() & 0x0fff;
            NumberOfIterations = ms.ReadUInt24BE() & 0x3ff;
        }

        public int TrClippingThreshold { get; }
        public uint NumberOfIterations { get; }
    }
}
