Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Public Member Functions | List of all members
key_bindings Class Reference

The key bindings. More...

#include <key_bindings.h>

Public Member Functions

 key_bindings (const sf::Keyboard::Key up, const sf::Keyboard::Key right, const sf::Keyboard::Key down, const sf::Keyboard::Key left, const sf::Keyboard::Key action_1, const sf::Keyboard::Key action_2, const sf::Keyboard::Key action_3, const sf::Keyboard::Key action_4)
 
std::vector< user_input_typecreate_actions (const sf::Keyboard::Key k) const noexcept
 From an event, create zero or one user inputs.
 
sf::Keyboard::Key get_key_for_action (const action_number &action) const
 Get the key for action 1, 2, 3 or 4.
 
sf::Keyboard::Key get_key_for_move_down () const noexcept
 Get the key for moving down.
 
sf::Keyboard::Key get_key_for_move_left () const noexcept
 Get the key for moving left.
 
sf::Keyboard::Key get_key_for_move_right () const noexcept
 Get the key for moving right.
 
sf::Keyboard::Key get_key_for_move_up () const noexcept
 Get the key for moving up.
 

Detailed Description

The key bindings.

This class connects a key to an action, where an action can be a cursor movement or an actual action, such as attack, move, etc.

Constructor & Destructor Documentation

◆ key_bindings()

key_bindings::key_bindings ( const sf::Keyboard::Key  up,
const sf::Keyboard::Key  right,
const sf::Keyboard::Key  down,
const sf::Keyboard::Key  left,
const sf::Keyboard::Key  action_1,
const sf::Keyboard::Key  action_2,
const sf::Keyboard::Key  action_3,
const sf::Keyboard::Key  action_4 
)

Member Function Documentation

◆ create_actions()

std::vector< user_input_type > key_bindings::create_actions ( const sf::Keyboard::Key  k) const
noexcept

From an event, create zero or one user inputs.

Return the 'user_input_type' corresponding to an event

◆ get_key_for_action()

sf::Keyboard::Key key_bindings::get_key_for_action ( const action_number action) const

Get the key for action 1, 2, 3 or 4.

◆ get_key_for_move_down()

sf::Keyboard::Key key_bindings::get_key_for_move_down ( ) const
inlinenoexcept

Get the key for moving down.

◆ get_key_for_move_left()

sf::Keyboard::Key key_bindings::get_key_for_move_left ( ) const
inlinenoexcept

Get the key for moving left.

◆ get_key_for_move_right()

sf::Keyboard::Key key_bindings::get_key_for_move_right ( ) const
inlinenoexcept

Get the key for moving right.

◆ get_key_for_move_up()

sf::Keyboard::Key key_bindings::get_key_for_move_up ( ) const
inlinenoexcept

Get the key for moving up.


The documentation for this class was generated from the following files: