Mario editor: use visitors
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#include "edit_box.hpp"
|
||||
|
||||
EditBox::EditBox(int x, int y, std::shared_ptr<SDLPP::Renderer> renderer) : SDLPP::RectangleRender(BLOCK_SIZE + x*BLOCK_SIZE, 4*BLOCK_SIZE + y*BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, renderer) {
|
||||
_x = x;
|
||||
_y = y;
|
||||
setId(EDITOR_EDIT_SQUARE);
|
||||
setColiderColor("#FF00AA");
|
||||
setPermanent();
|
||||
setAlignment(SDLPP::OBJ_CENTER, SDLPP::OBJ_CENTER);
|
||||
addCollision(SDLPP::RectColider(0,0,1,1));
|
||||
}
|
||||
|
||||
SDLPP::Vec2D<int> EditBox::getIndexes() const {
|
||||
return {_x, _y};
|
||||
}
|
||||
|
||||
void EditBox::visit( SDLPP::Visitor &visitor ) {
|
||||
visitor.visit( *this );
|
||||
}
|
||||
Reference in New Issue
Block a user