From fe4142b9a67a6795acd8fa941be9d32e05ac9e51 Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Fri, 14 May 2021 19:02:21 +0200 Subject: [PATCH] now following coplien form --- lib/Ray/include/Color.hpp | 4 ++-- lib/Ray/include/Controllers/Gamepad.hpp | 4 ++-- lib/Ray/include/Drawables/Basic/Circle.hpp | 6 ++++-- lib/Ray/include/Drawables/Basic/Line.hpp | 4 ++-- lib/Ray/include/Drawables/Basic/Point.hpp | 4 ++-- lib/Ray/include/Drawables/Basic/Rectangle.hpp | 4 ++-- lib/Ray/include/Drawables/Basic/Text.hpp | 4 ++-- lib/Ray/include/Drawables/Drawable.hpp | 2 ++ lib/Ray/include/Drawables/Image.hpp | 6 +++--- lib/Ray/include/Window.hpp | 4 ++++ 10 files changed, 25 insertions(+), 17 deletions(-) diff --git a/lib/Ray/include/Color.hpp b/lib/Ray/include/Color.hpp index 92656abf..3eec951e 100644 --- a/lib/Ray/include/Color.hpp +++ b/lib/Ray/include/Color.hpp @@ -15,13 +15,13 @@ namespace Ray { public: Color(unsigned char r, unsigned char g, unsigned char b, unsigned char a); - Color(const Color &); + Color(const Color &) = default; Color(int hexValue); ~Color() = default; - Color &operator=(const Color &); + Color &operator=(const Color &) = default; Color &setR(unsigned char r); Color &setG(unsigned char g); diff --git a/lib/Ray/include/Controllers/Gamepad.hpp b/lib/Ray/include/Controllers/Gamepad.hpp index 38ad4f56..6d97bc71 100644 --- a/lib/Ray/include/Controllers/Gamepad.hpp +++ b/lib/Ray/include/Controllers/Gamepad.hpp @@ -21,9 +21,9 @@ namespace Ray { ~GamePad() = default; - GamePad(const GamePad &); + GamePad(const GamePad &) = default; - GamePad &operator=(const GamePad &); + GamePad &operator=(const GamePad &) = default; bool isPressed(Button); bool isDown(Button); diff --git a/lib/Ray/include/Drawables/Basic/Circle.hpp b/lib/Ray/include/Drawables/Basic/Circle.hpp index 610b37c6..41af694d 100644 --- a/lib/Ray/include/Drawables/Basic/Circle.hpp +++ b/lib/Ray/include/Drawables/Basic/Circle.hpp @@ -16,10 +16,12 @@ namespace Ray { { public: Circle(Vector2 topLeftPos, int radius, Color); + Circle(int topLeftX, int topLeftY, int radius, Color); - Circle(const Circle &); + + Circle(const Circle &) = default; - Circle &operator=(const Circle &); + Circle &operator=(const Circle &) = default; ~Circle() = default; diff --git a/lib/Ray/include/Drawables/Basic/Line.hpp b/lib/Ray/include/Drawables/Basic/Line.hpp index 753db20f..3ca1fabd 100644 --- a/lib/Ray/include/Drawables/Basic/Line.hpp +++ b/lib/Ray/include/Drawables/Basic/Line.hpp @@ -17,9 +17,9 @@ namespace Ray { public: Line(Vector2 position, int length, Color); Line(int x, int y, int length, Color); - Line(const Line &); + Line(const Line &) = default; - Line &operator=(const Line &); + Line &operator=(const Line &) = default; ~Line() = default; diff --git a/lib/Ray/include/Drawables/Basic/Point.hpp b/lib/Ray/include/Drawables/Basic/Point.hpp index 58c9324d..2a8af86b 100644 --- a/lib/Ray/include/Drawables/Basic/Point.hpp +++ b/lib/Ray/include/Drawables/Basic/Point.hpp @@ -17,9 +17,9 @@ namespace Ray { public: Point(Vector2 position, Color); Point(int x, int y, Color); - Point(const Point &); + Point(const Point &) = default; - Point &operator=(const Point &); + Point &operator=(const Point &) = default; ~Point() = default; }; diff --git a/lib/Ray/include/Drawables/Basic/Rectangle.hpp b/lib/Ray/include/Drawables/Basic/Rectangle.hpp index 3ec59a8a..afe1249a 100644 --- a/lib/Ray/include/Drawables/Basic/Rectangle.hpp +++ b/lib/Ray/include/Drawables/Basic/Rectangle.hpp @@ -17,9 +17,9 @@ namespace Ray { public: Rectangle(Vector2 position, Vector2 dimensions,int length, Color); Rectangle(int x, int y, int width, int height, int length, Color); - Rectangle(const Rectangle &); + Rectangle(const Rectangle &) = default; - Rectangle &operator=(const Rectangle &); + Rectangle &operator=(const Rectangle &) = default; ~Rectangle() = default; diff --git a/lib/Ray/include/Drawables/Basic/Text.hpp b/lib/Ray/include/Drawables/Basic/Text.hpp index 0e718285..e14ec383 100644 --- a/lib/Ray/include/Drawables/Basic/Text.hpp +++ b/lib/Ray/include/Drawables/Basic/Text.hpp @@ -17,9 +17,9 @@ namespace Ray { public: Text(const std::string &text, int fontSize, Vector2 position, Color); Text(const std::string &text, int fontSize, int x, int y, Color); - Text(const Text &); + Text(const Text &) = default; - Text &operator=(const Text &); + Text &operator=(const Text &) = default; ~Text() = default; diff --git a/lib/Ray/include/Drawables/Drawable.hpp b/lib/Ray/include/Drawables/Drawable.hpp index dd55d495..b3fd2cc0 100644 --- a/lib/Ray/include/Drawables/Drawable.hpp +++ b/lib/Ray/include/Drawables/Drawable.hpp @@ -21,6 +21,8 @@ namespace Ray { public: Drawable(Vector2 position, Color color); Drawable(int x, int y, Color color); + + Drawable(const Drawable &) = default; virtual ~Drawable() = 0; const Vector2 &getPosition(void) const; diff --git a/lib/Ray/include/Drawables/Image.hpp b/lib/Ray/include/Drawables/Image.hpp index 5c4b3c6d..0bfded7a 100644 --- a/lib/Ray/include/Drawables/Image.hpp +++ b/lib/Ray/include/Drawables/Image.hpp @@ -20,16 +20,16 @@ namespace Ray Image(const Image &); Image(); - Image &operator=(const Image &); + Image &operator=(const Image &) = default; + ~Image(); + bool load(const std::string &filename); bool exportTo(const std::string &outputPath); bool unload(); const ::Image &getImage(void) const; - ~Image(); - void draw(const Rectangle &); void draw(const Line &); void draw(const Point &); diff --git a/lib/Ray/include/Window.hpp b/lib/Ray/include/Window.hpp index 2adc161a..ec456815 100644 --- a/lib/Ray/include/Window.hpp +++ b/lib/Ray/include/Window.hpp @@ -19,6 +19,10 @@ namespace Ray { public: // Creates window, and opens it if openNow is set to true Window(int width, int height, const std::string title, bool openNow = false); + + Window(const Window &) = default; + + Window &operator=(const Window &) = default; //Closes window if still open ~Window() = default;