game/mario/blocks/coineditorblock.hpp
zv0n 0d855ed218
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone Build was killed
Mario: formatting
2021-10-18 10:10:43 +02:00

31 lines
806 B
C++

#ifndef COIN_BLOCK_H
#define COIN_BLOCK_H
#include "../blocks.hpp"
#include "../global_vars.hpp"
#include "../sprites.hpp"
#include "../../sdlpp/sdlpp_textrenderer.hpp"
class CoinEditorBlock : public MarioBlock {
public:
CoinEditorBlock(int x, int y, std::shared_ptr<SDLPP::Renderer> renderer);
void render() override;
void updateSizeAndPosition() override;
void addOne();
void subtractOne();
void setAmount(int amount);
void onScrollUp() override;
void onScrollDown() override;
uint8_t getData() const override;
void setData(uint8_t data) override;
private:
void updateText();
int _amount = 1;
std::shared_ptr<SDLPP::TextRenderer> _amount_text;
constexpr static double size_divisor = 1.5;
constexpr static uint8_t max_amount = 15;
};
#endif