holesome/src/game/input/input_mapper.h
2023-05-10 14:51:09 +02:00

34 lines
672 B
C++

#ifndef HOLESOME_INPUT_MAPPER_H
#define HOLESOME_INPUT_MAPPER_H
#include "../game.h"
#include <SFML/Window/Event.hpp>
#include "../../config.h"
#include "direction.h"
class Game;
/**
* Maps the inputs to actions.
*/
class InputMapper
{
public:
static void setGame(Game *game);
static void processEvents();
static Direction getInputDirection();
private:
static inline Game *game = nullptr;
static inline std::vector<HardDirection> inputDirectionBuffer = std::vector<HardDirection>();
static void handleKeyPress(sf::Event::KeyEvent event);
static void handleKeyRelease(sf::Event::KeyEvent event);
};
#endif //HOLESOME_INPUT_MAPPER_H