Example #1
0
 public override object VisitConstSymmetry([NotNull] ChessVCParser.ConstSymmetryContext context)
 {
     if (context.GetText() == "MirrorSymmetry")
     {
         return(new MirrorSymmetry());
     }
     else if (context.GetText() == "RotationalSymmetry")
     {
         return(new RotationalSymmetry());
     }
     else if (context.GetText() == "NoSymmetry")
     {
         return(new NoSymmetry());
     }
     return(null);
 }
        public override object VisitConstSymmetry([NotNull] ChessVCParser.ConstSymmetryContext context)
        {
            string txt = context.GetText();

            if (txt == "MirrorSymmetry")
            {
                return(new MirrorSymmetry());
            }
            else if (txt == "RotationalSymmetry")
            {
                return(new RotationalSymmetry());
            }
            else if (txt == "NoSymmetry")
            {
                return(new NoSymmetry());
            }
            throw new Exception("!");
        }