diff --git a/lib/Ray/sources/Drawables/ADrawable2D.cpp b/lib/Ray/sources/Drawables/ADrawable2D.cpp index ad1a9608..f1aa3b59 100644 --- a/lib/Ray/sources/Drawables/ADrawable2D.cpp +++ b/lib/Ray/sources/Drawables/ADrawable2D.cpp @@ -7,44 +7,46 @@ #include "Drawables/ADrawable2D.hpp" -RAY::Drawables::Drawables2D::ADrawable2D::ADrawable2D(const Vector2 &position, const RAY::Color &color): - _position(position), _color(color) +namespace RAY::Drawables::Drawables2D { -} + ADrawable2D::ADrawable2D(const Vector2 &position, const RAY::Color &color) : + _position(position), _color(color) + { + } -RAY::Drawables::Drawables2D::ADrawable2D::ADrawable2D(int x, int y, const RAY::Color &color): - _position(x, y), _color(color) -{ + ADrawable2D::ADrawable2D(int x, int y, const RAY::Color &color) : + _position(static_cast(x), static_cast(y)), _color(color) + { + } -} + const RAY::Vector2 &ADrawable2D::getPosition(void) const + { + return this->_position; + } -const RAY::Vector2 &RAY::Drawables::Drawables2D::ADrawable2D::getPosition(void) const -{ - return this->_position; -} + const RAY::Color &ADrawable2D::getColor(void) const + { + return this->_color; + } -const RAY::Color &RAY::Drawables::Drawables2D::ADrawable2D::getColor(void) const -{ - return this->_color; -} + ADrawable2D &ADrawable2D::setPosition(const Vector2 &position) + { + this->_position = position; + return *this; + } -RAY::Drawables::Drawables2D::ADrawable2D &RAY::Drawables::Drawables2D::ADrawable2D::setPosition(const Vector2 &position) -{ - this->_position = position; - return *this; -} + ADrawable2D &ADrawable2D::setPosition(int x, int y) + { + this->_position.x = static_cast(x); + this->_position.y = static_cast(y); + return *this; + } -RAY::Drawables::Drawables2D::ADrawable2D &RAY::Drawables::Drawables2D::ADrawable2D::setPosition(int x, int y) -{ - this->_position.x = x; - this->_position.y = y; - return *this; -} - -RAY::Drawables::Drawables2D::ADrawable2D &RAY::Drawables::Drawables2D::ADrawable2D::setColor(const Color &color) -{ - this->_color = color; - return *this; -} + ADrawable2D &ADrawable2D::setColor(const Color &color) + { + this->_color = color; + return *this; + } +} \ No newline at end of file diff --git a/lib/Ray/sources/Drawables/ADrawable2D.hpp b/lib/Ray/sources/Drawables/ADrawable2D.hpp index 11108da2..eeabac1e 100644 --- a/lib/Ray/sources/Drawables/ADrawable2D.hpp +++ b/lib/Ray/sources/Drawables/ADrawable2D.hpp @@ -50,7 +50,7 @@ namespace RAY::Drawables::Drawables2D { ADrawable2D &setColor(const Color &color); //! @brief Draw drawble on window - virtual void drawOn(RAY::Window &) = 0; + void drawOn(RAY::Window &) override = 0; //! @brief Draw drawble on image virtual void drawOn(RAY::Image &image) = 0; diff --git a/lib/Ray/sources/Drawables/ADrawable3D.cpp b/lib/Ray/sources/Drawables/ADrawable3D.cpp index 447ad250..0cd66c30 100644 --- a/lib/Ray/sources/Drawables/ADrawable3D.cpp +++ b/lib/Ray/sources/Drawables/ADrawable3D.cpp @@ -7,32 +7,33 @@ #include "Drawables/ADrawable3D.hpp" -RAY::Drawables::Drawables3D::ADrawable3D::ADrawable3D(const RAY::Vector3 &position, const RAY::Color &color): - _position(position), _color(color) +namespace RAY::Drawables::Drawables3D { -} + ADrawable3D::ADrawable3D(const RAY::Vector3 &position, const RAY::Color &color) : + _position(position), _color(color) + { + } -const RAY::Color &RAY::Drawables::Drawables3D::ADrawable3D::getColor(void) const -{ - return this->_color; -} + const RAY::Color &ADrawable3D::getColor(void) const + { + return this->_color; + } -RAY::Drawables::Drawables3D::ADrawable3D &RAY::Drawables::Drawables3D::ADrawable3D::setColor(const RAY::Color &color) -{ - this->_color = color; - return *this; -} + ADrawable3D &ADrawable3D::setColor(const RAY::Color &color) + { + this->_color = color; + return *this; + } + const RAY::Vector3 &ADrawable3D::getPosition(void) const + { + return this->_position; + } -const RAY::Vector3 &RAY::Drawables::Drawables3D::ADrawable3D::getPosition(void) const -{ - return this->_position; -} - - -RAY::Drawables::Drawables3D::ADrawable3D &RAY::Drawables::Drawables3D::ADrawable3D::setPosition(const RAY::Vector3 &position) -{ - this->_position = position; - return *this; + ADrawable3D &ADrawable3D::setPosition(const RAY::Vector3 &position) + { + this->_position = position; + return *this; + } } \ No newline at end of file diff --git a/lib/Ray/sources/Drawables/ADrawable3D.hpp b/lib/Ray/sources/Drawables/ADrawable3D.hpp index b87d4a77..71301ebd 100644 --- a/lib/Ray/sources/Drawables/ADrawable3D.hpp +++ b/lib/Ray/sources/Drawables/ADrawable3D.hpp @@ -25,10 +25,10 @@ namespace RAY::Drawables::Drawables3D { ADrawable3D(const ADrawable3D &) = default; //! @brief A default destructor - virtual ~ADrawable3D() = default; + ~ADrawable3D() override = default; //! @brief Draw drawble on window - virtual void drawOn(RAY::Window &) = 0; + void drawOn(RAY::Window &) override = 0; //! @return the color of the ADrawable const RAY::Color &getColor(void) const;