From b06ddc0df34cc3ddff09d5aad358581146901bbf Mon Sep 17 00:00:00 2001 From: Le Juez Victor <90587919+Bigfoot71@users.noreply.github.com> Date: Sat, 14 Oct 2023 22:18:49 +0200 Subject: [PATCH] Reduction of the number of constructors --- include/Rectangle.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/Rectangle.hpp b/include/Rectangle.hpp index 08d208d1..5da5b06d 100644 --- a/include/Rectangle.hpp +++ b/include/Rectangle.hpp @@ -13,11 +13,8 @@ class Rectangle : public ::Rectangle { public: Rectangle(const ::Rectangle& rect) : ::Rectangle{rect.x, rect.y, rect.width, rect.height} {} - Rectangle(float x, float y, float width, float height) : ::Rectangle{x, y, width, height} {} - Rectangle(float x, float y, float width) : ::Rectangle{x, y, width, 0} {} - Rectangle(float x, float y) : ::Rectangle{x, y, 0, 0} {} - Rectangle(float x) : ::Rectangle{x, 0, 0, 0} {} - Rectangle() : ::Rectangle{0, 0, 0, 0} {} + Rectangle(float x = 0, float y = 0, float width = 0, float height = 0) + : ::Rectangle{x, y, width, height} {} Rectangle(::Vector2 position, ::Vector2 size) : ::Rectangle{position.x, position.y, size.x, size.y} {}