game/sdlpp/sdlpp_circlerenderer.hpp

60 lines
2.2 KiB
C++

#ifndef SDLPP_HPP_CIRCLE_RENDERER
#define SDLPP_HPP_CIRCLE_RENDERER
#include "sdlpp_common.hpp"
#include "sdlpp_renderobject.hpp"
#include <memory>
namespace SDLPP {
class SDLPPSCOPE CircleRender : public RenderObject {
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,
std::shared_ptr< Texture > &t );
CircleRender( double x, double y, double rad,
std::shared_ptr< Renderer > &r,
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 );
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 > >
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;
private:
virtual void copyTo( std::shared_ptr< RenderObject > other ) override;
void updateXY();
double og_r;
double r_;
std::string color = "";
};
} // end of namespace SDLPP
#endif