namespace InABox.DigitalMatter
{
    public class DMOperatorField : DMField
    {
        public DMOperatorField()
        {
            Data = new byte[] { };
        }

        public override byte Type => 0x03;

        public byte[] Data { get; set; }

        protected override void DoDecode()
        {
            int type = TakeByte();
            Data = TakeBytes(BufferSize - 1);
        }

        protected override void DoEncode()
        {
            AddByte(Type);
            AddBytes(Data);
        }

        public override bool IsValid()
        {
            return true;
        }
    }
}