-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyBoardSystem.hpp
More file actions
35 lines (26 loc) · 945 Bytes
/
KeyBoardSystem.hpp
File metadata and controls
35 lines (26 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// Created by Fabien on 11/01/2016.
//
#ifndef SWRPG_KEYBOARDSYSTEM_H
#define SWRPG_KEYBOARDSYSTEM_H
#include "Imports.hpp"
#include "Components.hpp"
class KeyBoardSystem : public entityx::System<KeyBoardSystem>, public entityx::Receiver<KeyBoardSystem>
{
public:
KeyBoardSystem(sf::RenderWindow &target) : mTarget(target)
{
mChai.add(chaiscript::base_class<sf::Window, sf::RenderWindow>());
mChai.add(chaiscript::var(&mTarget), "window");
mChai.add(chaiscript::fun(&sf::Window::close), "close");
}
void configure(entityx::EventManager &event_manager);
void update(entityx::EntityManager &es, entityx::EventManager &events, entityx::TimeDelta dt);
void receive(const sf::Event &event);
private:
sf::RenderWindow &mTarget;
chaiscript::ChaiScript mChai;
std::string convertToValue(const sf::Event &event);
std::string getRealTimeKey();
};
#endif //SWRPG_KEYBOARDSYSTEM_H