mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-04 18:46:22 +00:00
3D drawables all have a position. Non-positionable object will throw an error when a setter/getter is called
This commit is contained in:
@@ -17,8 +17,9 @@ namespace RAY::Drawables::Drawables3D {
|
||||
class ADrawable3D: public IDrawable
|
||||
{
|
||||
public:
|
||||
//! @param Color Color of the drawable
|
||||
ADrawable3D(const RAY::Color &color);
|
||||
//! @param Color Color of the drawable
|
||||
//! @param Position Position of the drawable (wether its center or start position for lines)
|
||||
ADrawable3D(const RAY::Vector3 &position, const RAY::Color &color);
|
||||
|
||||
//! @brief A default copy constructor
|
||||
ADrawable3D(const ADrawable3D &) = default;
|
||||
@@ -30,12 +31,21 @@ namespace RAY::Drawables::Drawables3D {
|
||||
virtual void drawOn(RAY::Window &) = 0;
|
||||
|
||||
//! @return the color of the ADrawable
|
||||
const Color &getColor(void) const;
|
||||
const RAY::Color &getColor(void) const;
|
||||
|
||||
//! @brief set color
|
||||
ADrawable3D &setColor(const RAY::Color &color);
|
||||
|
||||
//! @return the position of the ADrawable
|
||||
virtual const Vector3 &getPosition(void) const;
|
||||
|
||||
//! @brief set position
|
||||
virtual ADrawable3D &setPosition(const Vector3 &position);
|
||||
|
||||
protected:
|
||||
//! @brief Position of the ADrawable
|
||||
Vector3 _position;
|
||||
|
||||
//! @brief Color of the ADrawable
|
||||
Color _color;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user