38 lines
902 B
C++
38 lines
902 B
C++
/**
|
|
* @author: Thomas Brandého
|
|
*/
|
|
|
|
#ifndef INPUT_H
|
|
#define INPUT_H
|
|
#include "keybindings.h"
|
|
#include <queue>
|
|
#include <vector>
|
|
|
|
class Input{
|
|
public:
|
|
//enum Context {MENU, EDITOR, GAME, DEBUG, NB_CONTEXT};
|
|
Input(sf::Window* w, std::string keysmappings, int nb_actions);
|
|
int getKeyBinding(int action, int num);
|
|
void setkeyBinding(int action, int num, sf::Keyboard::Key key);
|
|
bool createContext(std::string context_name, std::vector<int> action_list);
|
|
void setCurrentContext(std::string context_name);
|
|
|
|
// void updateEvents();
|
|
// int getAction();
|
|
// void reloadKeyBindings();
|
|
/*
|
|
*/
|
|
private:
|
|
sf::Window* window;
|
|
KeysMap keysmap;
|
|
/*
|
|
std::queue<int> action_file;
|
|
Context current_context;
|
|
std::vector<int> contexts[NB_CONTEXT];
|
|
std::vector<Context> contexts;
|
|
KeyBindings keybindings[NB_CONTEXT];
|
|
*/
|
|
};
|
|
|
|
#endif
|