コード例 #1
0
        private static ReadResults SetLimit(EntitySelectorParser parser, IStringReader reader)
        {
            ReadResults readResults = reader.ReadInteger(out int number);

            if (!readResults.Successful)
            {
                return(readResults);
            }

            if (number < 1)
            {
                return(ReadResults.Failure(CommandError.SelectorLimitTooLow().WithContext(reader)));
            }
            parser.SetMaxResults(number);
            parser.AddArgument(new ParsedArgument <int>(number, false));
            return(ReadResults.Success());
        }