2020-11-21 19:57:40 +00:00
|
|
|
#ifndef SDLPP_HPP_CIRCLE_RENDERER
|
|
|
|
#define SDLPP_HPP_CIRCLE_RENDERER
|
|
|
|
|
|
|
|
#include "sdlpp_common.hpp"
|
|
|
|
#include "sdlpp_renderobject.hpp"
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace SDLPP {
|
2020-11-22 22:37:55 +00:00
|
|
|
class SDLPPSCOPE CircleRender : public RenderObject {
|
2020-11-21 19:57:40 +00:00
|
|
|
public:
|
|
|
|
CircleRender() = delete;
|
|
|
|
virtual ~CircleRender(){};
|
2021-03-13 17:36:29 +00:00
|
|
|
CircleRender( double x, double y, double rad,
|
|
|
|
std::shared_ptr< Renderer > &r );
|
|
|
|
CircleRender( double x, double y, double rad,
|
|
|
|
std::shared_ptr< Renderer > &r,
|
2020-11-21 19:57:40 +00:00
|
|
|
std::shared_ptr< Texture > &t );
|
2021-03-13 17:36:29 +00:00
|
|
|
CircleRender( double x, double y, double rad,
|
|
|
|
std::shared_ptr< Renderer > &r,
|
2021-01-31 20:48:48 +00:00
|
|
|
const std::string &img_or_color, bool is_polygon = false );
|
2021-03-12 21:33:46 +00:00
|
|
|
|
2021-03-13 17:36:29 +00:00
|
|
|
CircleRender( Vec2D< double > center, double rad,
|
|
|
|
std::shared_ptr< Renderer > &r );
|
|
|
|
CircleRender( Vec2D< double > center, double rad,
|
|
|
|
std::shared_ptr< Renderer > &r,
|
2021-03-12 21:33:46 +00:00
|
|
|
std::shared_ptr< Texture > &t );
|
2021-03-13 17:36:29 +00:00
|
|
|
CircleRender( Vec2D< double > center, double rad,
|
|
|
|
std::shared_ptr< Renderer > &r,
|
2021-03-12 21:33:46 +00:00
|
|
|
const std::string &img_or_color, bool is_polygon = false );
|
2021-01-31 20:48:48 +00:00
|
|
|
virtual void setColor( const std::string &color ) override;
|
|
|
|
virtual void setOutlineColor( const std::string &color ) override;
|
2021-03-13 17:36:29 +00:00
|
|
|
virtual void specialAction( int /*UNUSED*/ ) override {}
|
|
|
|
virtual void custom_move( int /*UNUSED*/ ) override {}
|
|
|
|
virtual std::pair< Vec2D< double >, Vec2D< double > >
|
2021-01-31 20:48:48 +00:00
|
|
|
getDoubleRect() const override;
|
|
|
|
virtual int leftmost() override;
|
|
|
|
virtual int topmost() override;
|
|
|
|
virtual int rightmost() override;
|
|
|
|
virtual int bottommost() override;
|
|
|
|
virtual int collisionPushX() override;
|
|
|
|
virtual int collisionPushY() override;
|
|
|
|
virtual int collisionWidth() override;
|
|
|
|
virtual int collisionHeight() override;
|
|
|
|
virtual void updateSizeAndPosition() override;
|
|
|
|
virtual SDL_Rect getRect() override;
|
|
|
|
virtual void centerX() override;
|
|
|
|
virtual std::shared_ptr< RenderObject > copySelf() override;
|
|
|
|
std::string getColor() const;
|
2020-11-21 19:57:40 +00:00
|
|
|
|
|
|
|
private:
|
2021-03-13 17:36:29 +00:00
|
|
|
virtual void copyTo( std::shared_ptr< RenderObject > other ) override;
|
2021-01-31 20:48:48 +00:00
|
|
|
void updateXY();
|
|
|
|
double og_r;
|
|
|
|
double r_;
|
|
|
|
std::string color = "";
|
2020-11-21 19:57:40 +00:00
|
|
|
};
|
|
|
|
} // end of namespace SDLPP
|
|
|
|
#endif
|