#ifndef __BUTTON_H__ # define __BUTTON_H__ # include # include # include "Core/Core.hh" # include "SubMenu.hh" namespace DamnCute { class Button : public IRenderable { private: std::vector::iterator _itSub; std::vector _sub; const std::string _name; bool _alive; int _x; int _y; int _offsetx = 0; int _offsety = 0; bool _start = false; sf::Sprite _s; sf::Texture& _tex; sf::Text _text; public: explicit Button(const std::string &, sf::Text &, int, int, sf::Texture&); virtual ~Button() = default; inline void operator=(const Button& b) { _tex = b._tex; _s = b._s; _text = b._text; } virtual void update(sf::RenderTarget*); int getX(); int getY(); bool getStart(); const std::string getName(); void setAlive(); void setAlive2(); void setOffsets(int, int); void setPos(int, int); void setStart(); bool hasField(const std::string &); const std::string getField(const std::string &); void moveDown(); void moveUp(); void moveRight(); void moveLeft(); void addSubMenu(SubMenu *b); }; }; #endif