public int CompareTo(object obj) { Shape3D shape = obj as Shape3D; if (shape != null) { return(this.GetVolume().CompareTo(shape.GetVolume())); } else { throw new Exception("Can't compare object"); } }
public void AddShape(Shape3D shape) { shapes.Add(shape); }