Split sdlpp into smaller files
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
#include "sdlpp_circlerenderer.hpp"
|
||||
|
||||
namespace SDLPP {
|
||||
CircleRender::CircleRender( int x, int y, int rad,
|
||||
std::shared_ptr< Renderer > &r )
|
||||
: RenderObject( r ) {
|
||||
x_ = x;
|
||||
y_ = y;
|
||||
rad_ = rad;
|
||||
}
|
||||
|
||||
CircleRender::CircleRender( int x, int y, int rad,
|
||||
std::shared_ptr< Renderer > &r,
|
||||
std::shared_ptr< Texture > &t )
|
||||
: CircleRender( x, y, rad, r ) {
|
||||
setTexture( t );
|
||||
}
|
||||
|
||||
CircleRender::CircleRender( int x, int y, int rad,
|
||||
std::shared_ptr< Renderer > &r,
|
||||
const std::string &img_path )
|
||||
: CircleRender( x, y, rad, r ) {
|
||||
auto texture = std::make_shared< Texture >( r, img_path );
|
||||
setTexture( texture );
|
||||
}
|
||||
|
||||
void CircleRender::render() {
|
||||
std::cout << "I'm a circle, look at me go!" << std::endl
|
||||
<< "My dimensions are: [" << x_ << ", " << y_
|
||||
<< "], radius: " << rad_ << std::endl;
|
||||
}
|
||||
|
||||
int CircleRender::leftmost() {
|
||||
return x_ - rad_;
|
||||
}
|
||||
|
||||
int CircleRender::topmost() {
|
||||
return y_ - rad_;
|
||||
}
|
||||
|
||||
int CircleRender::collisionPushX() {
|
||||
return x_;
|
||||
}
|
||||
|
||||
int CircleRender::collisionPushY() {
|
||||
return y_;
|
||||
}
|
||||
} // namespace SDLPP
|
||||
Reference in New Issue
Block a user