1#ifndef PHYSICAL_CONTROLLER_H
2#define PHYSICAL_CONTROLLER_H
38 const sf::Event& event,
39 const side player_side,
57 const sf::Event& event,
58 const side player_side
63 const sf::Event& event,
64 const side player_side
69 const sf::Event& event,
70 const side player_side,
92 const sf::Mouse::Button mouse_button
111 const
bool has_selected_units,
112 const
bool is_promoting_pawn,
113 const
bool is_king_that_may_castle_kingside,
114 const
bool is_king_that_may_castle_queenside,
The number of an action.
Definition action_number.h:12
The layout of the Game dialog.
Definition game_view_layout.h:61
The key bindings.
Definition key_bindings.h:19
The mouse bindings.
Definition mouse_bindings.h:19
A physical controller.
Definition physical_controller.h:19
const mouse_bindings & get_mouse_bindings() const
Get the mouse bindings, if this is a mouse.
Definition physical_controller.cpp:102
const key_bindings & get_key_bindings() const
Get the key bindings, if this is a keyboard.
Definition physical_controller.cpp:85
const physical_controller_type & get_type() const noexcept
Definition physical_controller.h:33
user_inputs process_input(const sf::Event &event, const side player_side, const game_view_layout &layout) const
Process the input for this controller.
Definition physical_controller.cpp:181
void set_type(const physical_controller_type t) noexcept
Definition physical_controller.h:43
The coordinate on a screen.
Definition screen_coordinate.h:12
key_bindings create_left_keyboard_key_bindings() noexcept
Create the key bindings for a player at the left side of a keyboard.
Definition key_bindings.cpp:67
sf::Event create_mouse_moved_event(const screen_coordinate &cursor_pos)
Create an sf::Event with type sf::Event::MouseMoved.
Definition physical_controller.cpp:67
physical_controller create_default_mouse_controller() noexcept
Create a mouse controller.
Definition physical_controller.cpp:28
sf::Event create_mouse_button_pressed_event(const screen_coordinate &cursor_pos, const sf::Mouse::Button mouse_button)
Create an sf::Event with type sf::Event::MouseButtonPressed.
Definition physical_controller.cpp:54
void test_controller()
Test this class and its free functions.
Definition physical_controller.cpp:271
physical_controller create_default_keyboard_controller() noexcept
Create a default keyboard controller, which is the left keyboard controller.
Definition physical_controller.cpp:23
sf::Keyboard::Key get_key_for_action(const physical_controller &c, const action_number &action)
Get the key for a action 1, 2, 3 or 4 for a controller.
Definition physical_controller.cpp:97
physical_controller create_right_keyboard_controller() noexcept
Create a keyboard controller for a user at the right side of the keyboard.
Definition physical_controller.cpp:76
physical_controller create_left_keyboard_controller() noexcept
Create a keyboard controller for a user at the left side of the keyboard.
Definition physical_controller.cpp:45
sf::Event create_key_pressed_event(const sf::Keyboard::Key k)
Create an sf::Event with type sf::Event::KeyPressed.
Definition physical_controller.cpp:37
std::string get_text_for_action(const physical_controller &c, const bool has_selected_units, const bool is_promoting_pawn, const bool is_king_that_may_castle_kingside, const bool is_king_that_may_castle_queenside, const action_number &action_key_number) noexcept
Get the text for action 1, 2, 3 or 4, e.g.
Definition physical_controller.cpp:108
physical_controller_type
The type of controller.
Definition physical_controller_type.h:15
side
The side the player/piece is on.
Definition side.h:11