Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
mouse_bindings.h
Go to the documentation of this file.
1#ifndef MOUSE_BINDINGS_H
2#define MOUSE_BINDINGS_H
3
4#include "ccfwd.h"
5#include "action_number.h"
6
7#include <SFML/Window/Mouse.hpp>
8
9#include <iosfwd>
10#include <map>
11
19{
20public:
22 const sf::Mouse::Button button_1 = sf::Mouse::Button::Left,
23 const sf::Mouse::Button button_2 = sf::Mouse::Button::Right
24 );
25
27 const sf::Mouse::Button& get_button_for_action(const action_number& n) const;
28
29private:
30
31 std::map<action_number, sf::Mouse::Button> m_buttons;
32
33};
34
37
38bool operator==(const mouse_bindings& lhs, const mouse_bindings& rhs) noexcept;
39
40std::ostream& operator<<(std::ostream& os, const mouse_bindings& keys) noexcept;
41
42#endif // MOUSE_BINDINGS_H
The number of an action.
Definition action_number.h:12
The mouse bindings.
Definition mouse_bindings.h:19
const sf::Mouse::Button & get_button_for_action(const action_number &n) const
Get the button to do the selected action.
Definition mouse_bindings.cpp:18
std::ostream & operator<<(std::ostream &os, const mouse_bindings &keys) noexcept
Definition mouse_bindings.cpp:60
bool operator==(const mouse_bindings &lhs, const mouse_bindings &rhs) noexcept
Definition mouse_bindings.cpp:53
void test_mouse_bindings()
Test this class and its free functions.
Definition mouse_bindings.cpp:23