Beispiel #1
0
        public ReadResults Parse(IStringReader reader, DispatcherResources resources, out float result)
        {
            int         start       = reader.GetCursor();
            ReadResults readResults = reader.ReadFloat(out result);

            if (readResults.Successful)
            {
                if (result < Minimum)
                {
                    reader.SetCursor(start);
                    return(ReadResults.Failure(CommandError.FloatTooLow(result, Minimum).WithContext(reader)));
                }

                if (result > Maximum)
                {
                    reader.SetCursor(start);
                    return(ReadResults.Failure(CommandError.FloatTooHigh(result, Maximum).WithContext(reader)));
                }
            }

            return(readResults);
        }