HeadBall  1.0
A game
InputManager.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SFML/Graphics.hpp>
4 
5  namespace HeadBall {
14  class InputManager {
15  public:
20  InputManager ( ) { }
21 
26  ~InputManager ( ) { }
27 
37  bool isSpriteClicked (sf::Sprite sprite, sf::Mouse::Button button, sf::RenderWindow& window);
38 
45  sf::Vector2i getMousePosition (sf::RenderWindow& window);
46 
55  bool isMoving (std::string direction, std::string player = "p1");
56 
65  bool isDoing (std::string action, std::string player = "p1");
66  };
67 }
Handle the input given by the user.
Definition: InputManager.hpp:14
bool isDoing(std::string action, std::string player="p1")
Check whether the player is performing a certain action or not.
Definition: InputManager.cpp:52
sf::Vector2i getMousePosition(sf::RenderWindow &window)
Get the Mouse Position object.
Definition: InputManager.cpp:15
~InputManager()
Destroy the Input Manager object.
Definition: InputManager.hpp:26
InputManager()
Construct a new Input Manager object.
Definition: InputManager.hpp:20
bool isSpriteClicked(sf::Sprite sprite, sf::Mouse::Button button, sf::RenderWindow &window)
Check whether a sprite is clicked or not.
Definition: InputManager.cpp:5
bool isMoving(std::string direction, std::string player="p1")
Check whether the player is moving or not.
Definition: InputManager.cpp:19
Custom namespace used throughout the project.
Definition: AboutState.cpp:6