Dragonfly 4.20
A text-based game engine
InputManager.h
1///
2/// The SFML input manager
3///
4
5#ifndef __INPUT_MANAGER_H__
6#define __INPUT_MANAGER_H__
7
8#include "Manager.h"
9
10// Two-letter acronym for easier access to manager.
11#define IM df::InputManager::getInstance()
12
13namespace df {
14
15class InputManager : public Manager {
16
17 private:
18 InputManager(); ///< Private since a singleton.
19 InputManager(InputManager const&); ///< Don't allow copy.
20 void operator=(InputManager const&);///< Don't allow assignment.
21
22 public:
23 /// Get the one and only instance of the InputManager.
25
26 /// Input manager only accepts keyboard and mouse events.
27 /// Return false if not one of them.
28 bool isValid(std::string event_type) const override;
29
30 /// Get window ready to capture input.
31 /// Return 0 if ok, else return -1;
32 int startUp() override;
33
34 /// Revert back to normal window mode.
35 void shutDown() override;
36
37 /// Get input from the keyboard and mouse.
38 /// Pass event along to all interested Objects.
39 void getInput() const;
40};
41
42} // end of namespace df
43#endif //__INPUT_MANAGER_H__
Definition: InputManager.h:15
void getInput() const
Get input from the keyboard and mouse.
void shutDown() override
Revert back to normal window mode.
InputManager()
Private since a singleton.
static InputManager & getInstance()
Get the one and only instance of the InputManager.
bool isValid(std::string event_type) const override
Input manager only accepts keyboard and mouse events.
void operator=(InputManager const &)
Don't allow assignment.
int startUp() override
Get window ready to capture input.
InputManager(InputManager const &)
Don't allow copy.
Definition: Manager.h:24
An animation for a sprite.
Definition: Animation.h:15