Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Classes | Functions
physical_controller.h File Reference
#include "ccfwd.h"
#include "key_bindings.h"
#include "mouse_bindings.h"
#include "physical_controller_type.h"
#include "side.h"
#include <iosfwd>
Include dependency graph for physical_controller.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  physical_controller
 A physical controller. More...
 

Functions

physical_controller create_default_keyboard_controller () noexcept
 Create a default keyboard controller, which is the left keyboard controller.
 
physical_controller create_default_mouse_controller () noexcept
 Create a mouse controller.
 
sf::Event create_key_pressed_event (const sf::Keyboard::Key k)
 Create an sf::Event with type sf::Event::KeyPressed.
 
physical_controller create_left_keyboard_controller () noexcept
 Create a keyboard controller for a user at the left side of the keyboard.
 
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.
 
sf::Event create_mouse_moved_event (const screen_coordinate &cursor_pos)
 Create an sf::Event with type sf::Event::MouseMoved.
 
physical_controller create_right_keyboard_controller () noexcept
 Create a keyboard controller for a user at the right side of the keyboard.
 
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.
 
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.
 
void test_controller ()
 Test this class and its free functions.
 
bool operator== (const physical_controller &lhs, const physical_controller &rhs) noexcept
 
bool operator!= (const physical_controller &lhs, const physical_controller &rhs) noexcept
 
std::ostream & operator<< (std::ostream &os, const physical_controller &c) noexcept
 

Function Documentation

◆ create_default_keyboard_controller()

physical_controller create_default_keyboard_controller ( )
noexcept

Create a default keyboard controller, which is the left keyboard controller.

◆ create_default_mouse_controller()

physical_controller create_default_mouse_controller ( )
noexcept

Create a mouse controller.

◆ create_key_pressed_event()

sf::Event create_key_pressed_event ( const sf::Keyboard::Key  k)

Create an sf::Event with type sf::Event::KeyPressed.

◆ create_left_keyboard_controller()

physical_controller create_left_keyboard_controller ( )
noexcept

Create a keyboard controller for a user at the left side of the keyboard.

◆ create_mouse_button_pressed_event()

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.

◆ create_mouse_moved_event()

sf::Event create_mouse_moved_event ( const screen_coordinate cursor_pos)

Create an sf::Event with type sf::Event::MouseMoved.

◆ create_right_keyboard_controller()

physical_controller create_right_keyboard_controller ( )
noexcept

Create a keyboard controller for a user at the right side of the keyboard.

◆ get_key_for_action()

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.

◆ get_text_for_action()

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.

'Q\nSelect' for a keyboard player that has nothing selected 'E\nAttack' for a keyboard player that has a piece select 'LMB\nSelect' for a mouse player that has nothing selected'

◆ operator!=()

bool operator!= ( const physical_controller lhs,
const physical_controller rhs 
)
noexcept

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const physical_controller c 
)
noexcept

◆ operator==()

bool operator== ( const physical_controller lhs,
const physical_controller rhs 
)
noexcept

◆ test_controller()

void test_controller ( )

Test this class and its free functions.