namespace InABox.DigitalMatter
{
    public class DMTripDataField : DMField
    {
        public override byte Type => 0x0F;

        public byte Reason { get; set; }
        public ushort Trimming { get; set; }

        protected override void DoDecode()
        {
            Reason = TakeByte();
            Trimming = TakeUInt16();
        }

        protected override void DoEncode()
        {
            AddByte(Reason);
            AddUInt16(Trimming);
        }

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