Example #1
0
        public FENError Validate(string fen)
        {
            fen = FENHelpers.SanitizeFenString(fen);
            foreach (var rule in _rules)
            {
                var rv = rule.Validate(fen);
                if (rv != FENError.None)
                {
                    throw new FENException(fen, rv);
                }
            }

            return(FENError.None);
        }
Example #2
0
        public FENError Validate(string fen)
        {
            fen = FENHelpers.SanitizeFenString(fen);
            if (string.IsNullOrEmpty(fen))
            {
                return(FENError.InvalidFENString);
            }

            var splitSectionsLength = fen.Split(SeperationCharacter).Length;

            if (splitSectionsLength != 6)
            {
                return(FENError.InvalidFENString);
            }

            return(FENError.None);
        }