skizzle/src/state.cpp

30 lines
672 B
C++
Raw Normal View History

#include "state.hpp"
#include "manager.hpp"
2016-03-28 18:02:23 +00:00
State::State(Manager& manager) : manager(manager) {}
State::~State() {}
2016-04-09 00:32:11 +00:00
void State::frame(const std::vector<sf::Event>& events) {
2016-04-09 00:32:11 +00:00
// traitement des événements
for (unsigned int i = 0; i < events.size(); i++) {
processEvent(events[i]);
}
}
Manager& State::getManager() {
return manager;
}
// raccourcis vers des méthodes du gestionnaire
ResourceManager& State::getResourceManager() {
return manager.getResourceManager();
}
sf::RenderWindow& State::getWindow() {
return manager.getWindow();
}
bool State::isKeyPressed(sf::Keyboard::Key key) const {
return manager.isKeyPressed(key);
}