#ifndef BLOCKS_H #define BLOCKS_H #include "../sdlpp/sdlpp_rectrenderer.hpp" #include class MarioBlock : public SDLPP::RectangleRender { public: MarioBlock(int x, int y, std::shared_ptr renderer, std::shared_ptr texture, SDL_Rect src); void visit( SDLPP::Visitor &visitor ) override; void setTool(bool tool = true); void setTerrain(bool terrain = true); private: bool _tool = false; bool _terrain = true; }; extern const std::vector possibleBlocks; enum BlockType { OVERWORLD = 0, UNDERWORLD = 1, WATER = 2, BOWSER = 4 }; std::shared_ptr createTerrainBlock( uint64_t block_id, BlockType type, std::shared_ptr &renderer, bool collision = false ); std::shared_ptr createTerrainBlock( uint64_t block_id, BlockType type, std::shared_ptr &renderer, int x, int y, bool collision = false ); std::shared_ptr createTerrainBlock( uint64_t block_id, BlockType type, std::shared_ptr &renderer, std::shared_ptr texture, bool collision = false ); std::shared_ptr createTerrainBlock( uint64_t block_id, BlockType type, std::shared_ptr &renderer, int x, int y, std::shared_ptr texture, bool collision = false ); std::shared_ptr createMario( BlockType type, std::shared_ptr &renderer, int x, int y ); SDL_Rect getSourceRectByID( uint64_t id, BlockType type ); #endif