예제 #1
0
        public IGeoCircle Parse(IParserInput input)
        {
            var inputAsString = input.ReadAll();
            var values        = _doubleParser.ParseToArrayOrEmpty(inputAsString);

            switch (values.Length)
            {
            case 2:
                return(_factory.CreateCircle(values[0], values[1], _fallbackRadius));

            case 3:
                return(_factory.CreateCircle(values[0], values[1], values[2]));

            default:
                throw new InvalidOperationException("expected two or 3 entries as input");
            }
        }
예제 #2
0
        public T Parse(IParserInput input)
        {
            var inputAsString = input.ReadAll();

            return(_converter.Convert(inputAsString));
        }