using System.IO;
using skyscraper5.Skyscraper.IO;

namespace skyscraper5.Teletext.Vps
{
    class VpsDataField
    {
        public VpsDataField(byte[] buffer)
        {
            MemoryStream ms = new MemoryStream(buffer);
            byte readUInt8 = ms.ReadUInt8();

            FieldParity = (readUInt8 & 0x20) != 0;
            LineOffset = (readUInt8 & 0x1f);

            byte[] readBytes = ms.ReadBytes(13);
            VpsDataBlock = new VpsDataBlock(readBytes);
        }

        public int LineOffset { get; private set; }

        public bool FieldParity { get; private set; }
        
        public VpsDataBlock VpsDataBlock { get; private set; }


    }
}
