using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper5.Rds
{
    [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
    public sealed class RdsMessageAttribute : Attribute
    {
        public byte MessageElementCode { get; }
        public RdsMessageHeaderType HeaderType { get; }

        public RdsMessageAttribute(byte messageElementCode,RdsMessageHeaderType headerType)
        {
            MessageElementCode = messageElementCode;
            HeaderType = headerType;
        }

        public bool NeedsDsn => HeaderType == RdsMessageHeaderType.DsnMel ||
                                HeaderType == RdsMessageHeaderType.DsnPsnMel ||
                                HeaderType == RdsMessageHeaderType.DsnPsn;

        public bool NeedsPsn => HeaderType == RdsMessageHeaderType.PsnMel ||
                                HeaderType == RdsMessageHeaderType.DsnPsn ||
                                HeaderType == RdsMessageHeaderType.DsnPsnMel;
    }
}
