49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
#ifndef SUBMENU_H_
|
|
# define SUBMENU_H_
|
|
|
|
# include <vector>
|
|
# include <string>
|
|
# include "Core/Core.hh"
|
|
|
|
namespace DamnCute {
|
|
class SubMenu : public IRenderable {
|
|
|
|
private:
|
|
bool _alive;
|
|
sf::Text _text;
|
|
std::vector<sf::Text *>::iterator _it;
|
|
std::vector<sf::Text *> _options;
|
|
|
|
public:
|
|
explicit SubMenu(sf::Text &, const std::string & , std::vector<sf::Text *>);
|
|
virtual ~SubMenu() = default;
|
|
|
|
inline void operator=(const SubMenu& b) {
|
|
_text = b._text;
|
|
}
|
|
|
|
void moveRight();
|
|
void moveLeft();
|
|
|
|
const std::string getName() {
|
|
return (_text.getString());
|
|
}
|
|
|
|
const std::string getField() {
|
|
return ((*_it)->getString());
|
|
}
|
|
|
|
void setAlive() {
|
|
if (_alive == false)
|
|
_alive = true;
|
|
else
|
|
_alive = false;
|
|
}
|
|
|
|
virtual void update(sf::RenderTarget*);
|
|
|
|
};
|
|
}
|
|
|
|
#endif
|