2021-05-07 07:43:57 +00:00
|
|
|
#include "tool_box.hpp"
|
|
|
|
#include "objectids.hpp"
|
|
|
|
#include "blocks.hpp"
|
|
|
|
#include "sprites.hpp"
|
|
|
|
|
2021-05-09 18:45:52 +00:00
|
|
|
ToolBox::ToolBox(int x, int y, int map_width, int map_height, std::shared_ptr<SDLPP::Renderer> renderer) : SDLPP::RectangleRender((map_width - 4)*BLOCK_SIZE + x*BLOCK_SIZE, 1*BLOCK_SIZE + y*BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, renderer) {
|
2021-05-07 07:43:57 +00:00
|
|
|
_x = x;
|
|
|
|
_y = y;
|
|
|
|
setId(EDITOR_TOOL_ID);
|
|
|
|
setColiderColor("#FF00AA");
|
|
|
|
setColor("#FFFFFF88");
|
|
|
|
setPermanent();
|
|
|
|
setAlignment(SDLPP::OBJ_CENTER, SDLPP::OBJ_CENTER);
|
|
|
|
addCollision(SDLPP::RectColider(0,0,1,1));
|
|
|
|
}
|
|
|
|
|
|
|
|
SDLPP::Vec2D<int> ToolBox::getIndexes() const {
|
|
|
|
return {_x, _y};
|
|
|
|
}
|
|
|
|
|
|
|
|
void ToolBox::visit( SDLPP::Visitor &visitor ) {
|
|
|
|
visitor.visit( *this );
|
|
|
|
}
|