public static void PrintAllBuffer(IBufferReadOnlyShape <AbstractShape> _ibuffer) { foreach (var item in _ibuffer) { String typeClass = item.GetType().ToString().Remove(0, 16); String paramName = typeClass.Equals("Circle") ? "radius-" : typeClass.Equals("Square")?"side-":"parameter-"; Console.WriteLine($"{typeClass} : with {paramName } {item._param} , area - {item._area } , circumference - {item._circumference}"); } }
public static AbstractShape DeleteBuffer(IBufferReadOnlyShape <AbstractShape> _buffer) { return(_buffer.delete()); }