public override string ToString() { // using string interpolation!!! return($"[Top left point - {TopLeft.ToString()}\n" + $"Bottom right point - {BotRight.ToString()}\n" + $"Height - {Height}\n" + $"Width - {Width}]\n"); }
public override Shape ToBounds(Rectangle fromBounds, Rectangle toBounds) { return(new Triangle ( Top.TranslatePoint(fromBounds, toBounds), BotLeft.TranslatePoint(fromBounds, toBounds), BotRight.TranslatePoint(fromBounds, toBounds) )); }
public object Clone() { var rectangle = (Rectangle)MemberwiseClone(); rectangle.TopLeft = (Point)TopLeft.Clone(); rectangle.BotRight = (Point)BotRight.Clone(); return(rectangle); }
public override string ToString() { return($"A Rectangle from {TopLeft.ToCoord()} to {BotRight.ToCoord()}"); }