game/sdlpp/sdlpp_circlerenderer.hpp

60 lines
2.2 KiB
C++
Raw Normal View History

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(){};
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 );
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 );
CircleRender( Vec2D< double > center, double rad,
std::shared_ptr< Renderer > &r );
CircleRender( Vec2D< double > center, double rad,
std::shared_ptr< Renderer > &r,
std::shared_ptr< Texture > &t );
CircleRender( Vec2D< double > center, double rad,
std::shared_ptr< Renderer > &r,
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;
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:
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