2021-04-25 20:42:55 +00:00
|
|
|
#ifndef BLOCKS_H
|
|
|
|
#define BLOCKS_H
|
|
|
|
|
|
|
|
#include "../sdlpp/sdlpp_rectrenderer.hpp"
|
|
|
|
#include <memory>
|
|
|
|
|
2021-05-02 12:14:11 +00:00
|
|
|
class MarioBlock : public SDLPP::RectangleRender {
|
|
|
|
public:
|
|
|
|
MarioBlock(int x, int y, std::shared_ptr<SDLPP::Renderer> renderer, std::shared_ptr<SDLPP::Texture> texture, SDL_Rect src);
|
|
|
|
void visit( SDLPP::Visitor &visitor ) override;
|
|
|
|
void setTool(bool tool = true);
|
2021-05-02 12:43:15 +00:00
|
|
|
void setCharacter(bool character = true);
|
2021-05-02 12:14:11 +00:00
|
|
|
private:
|
|
|
|
bool _tool = false;
|
2021-05-02 12:43:15 +00:00
|
|
|
bool _character = false;
|
2021-05-02 12:14:11 +00:00
|
|
|
};
|
|
|
|
|
2021-04-30 07:10:58 +00:00
|
|
|
extern const std::vector<uint64_t> possibleBlocks;
|
|
|
|
|
|
|
|
enum BlockType {
|
|
|
|
OVERWORLD = 0,
|
|
|
|
UNDERWORLD = 1,
|
|
|
|
WATER = 2,
|
2021-04-30 21:12:53 +00:00
|
|
|
BOWSER = 4
|
2021-04-30 07:10:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
std::shared_ptr<SDLPP::RectangleRender> createTerrainBlock( uint64_t block_id, BlockType type, std::shared_ptr<SDLPP::Renderer> &renderer, bool collision = false );
|
2021-05-02 12:14:11 +00:00
|
|
|
std::shared_ptr<SDLPP::RectangleRender> createTerrainBlock( uint64_t block_id, BlockType type, std::shared_ptr<SDLPP::Renderer> &renderer, int x, int y, bool collision = false );
|
2021-05-01 19:55:43 +00:00
|
|
|
std::shared_ptr<SDLPP::RectangleRender> createTerrainBlock( uint64_t block_id, BlockType type, std::shared_ptr<SDLPP::Renderer> &renderer, std::shared_ptr<SDLPP::Texture> texture, bool collision = false );
|
2021-05-02 12:14:11 +00:00
|
|
|
std::shared_ptr<SDLPP::RectangleRender> createTerrainBlock( uint64_t block_id, BlockType type, std::shared_ptr<SDLPP::Renderer> &renderer, int x, int y, std::shared_ptr<SDLPP::Texture> texture, bool collision = false );
|
|
|
|
std::shared_ptr<SDLPP::RectangleRender> createMario( BlockType type, std::shared_ptr<SDLPP::Renderer> &renderer, int x, int y );
|
2021-04-25 20:42:55 +00:00
|
|
|
|
2021-05-02 12:28:17 +00:00
|
|
|
SDL_Rect getSourceRectByID( uint64_t id, BlockType type );
|
|
|
|
|
2021-04-25 20:42:55 +00:00
|
|
|
#endif
|