You should fix your link
Also, you use interchangeably
int and
unsigned int for index access. You should use
unsigned int, or directly
std::size_t.
Then, top-level const qualifiers are useless:
void menu::setString(int item_number, const sf::String item_string)
You still perform a copy, and the caller isn't interested whether this copy is constant or not. What you probably want is a reference to a
const sf::String:
void menu::setString(int item_number, const sf::String& item_string)
You should also make your code const-correct in other places, and get rid of unnecessary parameters.
void setFont(sf::Font &font);
// ->
void setFont(const sf::Font& font);
int menu::getCurrentItem()
// ->
std::size_t menu::getCurrentItem() const
void menu::update(sf::RenderWindow &window, sf::Event &event)
// ->
void menu::update(const sf::Event& event)
Apart from that, the code looks good, I like the fact that you use STL containers and no
new/
delete