R-TYPE
Events.hpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2022
3 ** r-type
4 ** File description:
5 ** Events
6 */
7 
8 #ifndef EVENTS_HPP_
9 #define EVENTS_HPP_
10 
11 #include "SFML/Graphics.hpp"
12 #include <map>
13 #include <string>
14 #include <deque>
15 
16 enum class Button {
17  Left,
18  Right,
19  Up,
20  Down,
21  Space,
22  Q,
23  Z,
24  S,
25  D,
26  Enter,
27  F1,
28  F2,
29  F3,
30  F4,
31  F5,
32  F6,
33  F7,
34  None,
35 };
36 
37 enum class Mouse {
38  None,
39  Left,
40  Right,
41 };
42 
43 class Events {
44 public:
45  Events() = default;
46  ~Events() = default;
47 
48  std::deque<Button> getEventType(const sf::Event& event) const;
49  std::string getTextEntered(const sf::Event& event) const;
50  Mouse getEventTypeMouse(const sf::Event& event) const;
51 
52 protected:
53 private:
54  static const std::map<sf::Keyboard::Key, Button> eventsButton;
55  static const std::map<sf::Mouse::Button, Mouse> eventsMouse;
56  static const std::deque<sf::Keyboard::Key> keys;
57 };
58 
59 #endif /* !EVENTS_HPP_ */
Button
Definition: Events.hpp:16
Mouse
Definition: Events.hpp:37
Definition: Events.hpp:43
Events()=default
~Events()=default
Mouse getEventTypeMouse(const sf::Event &event) const
Definition: Events.cpp:94
std::deque< Button > getEventType(const sf::Event &event) const
Definition: Events.cpp:54
std::string getTextEntered(const sf::Event &event) const
Definition: Events.cpp:76