示例#1
0
 public bool Any()
 {
     return(MoveNAG != MoveNAG.Null ||
            PositionalNAGs.Any() ||
            TimeTroubleNAG != TimeTroubleNAG.Null ||
            NonStandardNAGs.Any());
 }
示例#2
0
 /// <summary>
 ///     Apply a Numeric Annotation Glyph (NAG) from an integer
 /// </summary>
 public void ApplyNag(int nag)
 {
     try
     {
         if (nag >= 1 && nag <= 9)
         {
             MoveNAG = (MoveNAG)nag;
         }
         else if (nag >= 10 && nag <= 135)
         {
             PositionalNAGs.Add((PositionalNAG)nag);
             PositionalNAGs = PositionalNAGs.Distinct().ToList();
         }
         else if (nag >= 136 && nag <= 139)
         {
             TimeTroubleNAG = (TimeTroubleNAG)nag;
         }
         else
         {
             NonStandardNAGs.Add((NonStandardNAG)nag);
             NonStandardNAGs = NonStandardNAGs.Distinct().ToList();
         }
     }
     catch (Exception)
     {
         LastError = $"Could not decipher NAG given {nag}";
     }
 }
示例#3
0
 public bool Equals(NumericAnnotation other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(AnnotationText == other.AnnotationText && MoveNAG == other.MoveNAG &&
            PositionalNAGs.SequenceEqual(other.PositionalNAGs) &&
            NonStandardNAGs.SequenceEqual(other.NonStandardNAGs) &&
            TimeTroubleNAG == other.TimeTroubleNAG && LastError == other.LastError);
 }