private static void FillResultsDictionary(GeometricShape shape, IDictionary <string, Results> shapeResults) { var key = shape.GetType().Name; if (!shapeResults.ContainsKey(key)) { shapeResults[key] = new Results { Amount = 1, Area = shape.CalculateArea(), Perimeter = shape.CalculatePerimeter() }; } else { shapeResults[key].Amount++; shapeResults[key].Perimeter += shape.CalculatePerimeter(); shapeResults[key].Area += shape.CalculateArea(); } }
private static string TraducirForma(GeometricShape shape, ILanguage idioma) { return($"{ idioma.PrintCount(shape) + " | " + idioma.PrintArea(shape) + " | " + idioma.PrintPerimeter(shape) }"); }